Operations reference
The complete list of RAGRAF facade operations: edition, what each one answers, key parameters and boundaries. All operations, grouped by task.
Updated: 2026-11-10
What this list is #
There are exactly 87 operations — a fixed set. There is no graph query language, and none is planned: instead of a free-form "ask anything", the agent picks an operation from the list, and the answer carries a file:line address, the kind of evidence and the boundaries. The list below is built from the product code (src/ragraf/facade.py), so the names and the count match what is installed on your machine.
An operation name is what you pass to the CLI (ragraf query <operation>) and what follows ragraf_ in the MCP tool name. The edition next to a name is the licence level that opens the operation: community works without a licence, pro and enterprise require a signed file.
How to read an answer #
Every answer is the same envelope, whatever the operation:
| Field | What it means |
|---|---|
op | which operation answered |
index_rev | which index revision supplied the facts |
capability | full, text-only or degraded — what was built in this revision |
edition, features | which edition is in force and which capabilities are open |
drift | divergence between the index and the code at the moment of the answer |
provenance | where the fact came from: index, graph or database |
limits | what the operation does not show — never empty when a boundary exists |
stale_warnings | which facts went stale, and why |
found | whether an answer was found at all |
result | the data itself |
Project rule: if a fact cannot be confirmed, it is not served as confirmed — it is either labelled derived, or named in limits, or the operation refuses (the kinds of refusal are on the "Errors and the next step" page).
Navigation and reading #
Answering a question about the code without reading whole files. Also the state of the corpus: freshness, the map, the registry.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
search | community | Hybrid search: lexis + vectors (RRF), every hit with its provenance | query, limit, kinds, with_text |
search_multi | community | 1a. Search "in one answer": several queries, copies, encodings (P1-1) | queries, limit, scope, regex |
symbol | community | A symbol: kind, file, lines, signature | name, path, limit, answer |
references | community | Every place a symbol is used | fqn, limit, min_confidence |
code | community | Symbol bodies — only on an explicit request | fqn, path, style, limit |
live_read | community | Reading the current file, highlighting what differs from the index (FT-31) | path, start, end |
neighbors | community | Neighbouring contours: a ready implementation of the same stack | query, name, limit, per_corpus |
route | community | The route: where the material lives and which local index answers | query, limit, verify |
freshness | community | Index freshness: whether the corpus checksum matches the code | force, auto_reindex |
repo_map | community | Repository map: modules → files → key symbols, within a token budget | scope, budget_tokens, detail |
catalog | community | Registry of projects: what is indexed, when, with which checksums | — |
skill_catalog | pro | Which skills the corpus carries and what reading each one costs, before any body is read | — |
skill_load | pro | The skill body page by page, with sha256 and next_offset; next_offset=0 means there is no continuation | name, offset, limit |
skill_reference | pro | A reference/<name>.md file of a skill by name; anything with a directory in it is refused with path_jail | name, file |
What it does not show. Search answers "where the text looks like the question", not "where the answer is": lexis and vectors decide, not meaning. A symbol is found by name, so a rename without reindexing yields the old picture.
Code graph #
Links between symbols and the price of an edit. Every edge carries its kind of evidence: confirmed by the analyser, or inferred from the name.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
callers | community | Who calls it | fqn, depth, hard_only, limit |
callees | community | What it calls (the confidence threshold is a parameter, stage 10) | fqn, depth, hard_only, limit |
impact | community | What a change will touch. Proven and heuristic links kept apart (FT-18) | target, mode, depth, limit |
slice | community | Structural slice: nodes + edges + lines, WITHOUT function bodies (FT-19) | fqn, direction, limit, min_confidence |
edge_evidence | community | A function's edges with their evidence: kind, how it was bound, coordinate | fqn, kind, limit |
diff | community | P2-1. What changed between revisions: files, symbols, edges, regressions | since, limit |
What it does not show. Static analysis does not see dynamic calls: call_user_func, reflections, method-name strings. An inferred link is labelled derived and does not count as evidence — the answer gives its number in limits.
Documents #
The document layer: fragment address, structure, markup validation, scan recognition, the document graph.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
doc_search | community | Search across document chunks: the fact, its address, its provenance | query, limit, kind, doc |
doc_get | community | Text by document address, with provenance: from the index or from disk | locator, with_provenance, asof |
doc_status | community | State of the document layer: statuses, reasons, budgets | doc_id |
doc_validate | community | Checking the integrity of the chunking: a verdict, not an impression | doc_id |
doc_search_levels | community | Dual-level search: local facts and the global level in one answer | query, limit, mode |
doc_ocr | pro | State of the OCR capability and the decision for one particular file | path |
entity_neighbors | pro | An entity's neighbours in the document graph: each with the address of its citation | entity, depth, kind, limit |
doc_relations | pro | Document links through shared entities: addresses on both sides | doc, entity, limit, asof |
themes | pro | Themes of the document graph: participants, addresses and a summary, where one exists | scope, limit |
global_overview | pro | Map of the document graph: how much of what, and which themes dominate | limit |
What it does not show. A fragment address is not meaning: a document answers "where it is written", and the parsing provenance explains how the fragment was obtained. Scan recognition does not repair the quality of the original.
Provenance and staleness #
From which document, and up to which date, a fact holds; what to recompute if the inputs changed.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
doc_asof | pro | Search across documents valid on a date (the validity interval) | query, date, limit, kind |
dependents | pro | What relied on a fact: direct and transitive dependencies along the edges | fact, locator, depth, include_stated |
stale_cascade | pro | What to recompute after the inputs change: a cascade along fact → fact edges | changed, depth, apply, clear |
What it does not show. The validity interval comes from the document, not from reality: if an edition is undated, the boundary is stated honestly but does not become exact.
Index quality #
Checks on the index itself: check suites, comparison of runs, traces of confirmed failures, threshold calibration.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
quality_trace | pro | Trace of a confirmed failure: record it, show it, replay it | action, case_id, trace_id, session |
quality_suite | pro | Index check suite: chunk size, signatures, vector, mode, breakdown | label, record, session |
quality_diff | pro | Breakdown of the divergences between two quality runs | from_run, to_run |
quality_pair | pro | Paired run: the same fixed cases, two runs, a verdict per case | from_run, to_run |
quality_prune | pro | Thinning the quality-run journal: a copy, a confirmation, entry numbers | keep, dry_run, confirm |
gate | community | P3-1 (§3.2). Gate decision on a tool call: allow / ask / deny | payload, mode |
calibrate | community | Threshold calibration (FT-11 of the specification) | kind, samples |
What it does not show. Index checks judge the index, not the product: a green suite means "the index is consistent with itself", not "the answers are correct".
Corpus structure #
What is indexed, what is not, and why: exclusions, copies, entry points, dead code, divergences and their journal.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
duplicates | community | 12b. File copies: "one name with numbers" groups and byte-identical ones (P1-2) | scope, limit |
entrypoints | community | 12a. Entry points and file reachability (P1-2) | path, scope, limit |
dead_code | community | 12c. Files and routines with no references and outside reachability (P1-2) | scope, limit |
excludes | pro | P2-4. Profile of "noisy" directories: what is excluded and what that costs | action, dirs, force |
preflight | pro | Price and boundaries BEFORE indexing: what it will cost and what will not be covered | root, sample |
drift_report | community | Journal of divergences | since, limit |
drift_ack | community | Acknowledging deltas: appending an ack, WITHOUT deleting the entry (FT-36) | entry_ids, note, by_whom |
What it does not show. Exclusions and dead code are a static verdict: code called from outside the corpus looks dead, and generated code looks like a duplicate.
Databases #
Schema, relations, sample rows, reads and writes, permissions and routes — before a query reaches the database.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
schema | community | Database schema from the project's migrations (M2, P1-4) | table, limit |
db_schema | community | Structure of the live databases: tables, columns, types, indexes | table, database, limit |
db_table | community | One table in detail: columns, indexes, relations, hidden fields | table, database |
db_relations | community | Table relations: declared and inferred from names, kept separate | table |
db_sample | community | Sample rows of a table: a snapshot marked with its staleness | table, database |
db_drift | community | What changed: between revisions AND between migrations and the database (P1-4) | previous_rev |
db_cross | community | "Code ↔ database" reconciliation: what does not match and who does what | — |
table_usage | community | Who reads a table and who writes it (U4, U5) | table, limit, mode |
write_check | community | Checking the write plan against the schema BEFORE execution (U1) | table, columns, operation, values |
policy_trace | community | Tracing decisions about permissions (U6) | symbol, action, depth, limit |
class_usage | community | Presentation classes: where each is defined, where used, what diverges | name, limit, mode |
routes | community | Routes and entry points: registrations and markup links (P1-3) | path, limit |
What it does not show. The schema is read from the database or from the code; a divergence between the two is named but not repaired. Permissions are a condition in the code, not a check on the server.
Corpus administration #
State, compact storage, notes and task labels — a service layer that answers nothing about the code, but without which the work cannot be done.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
index_status | community | Revision state, coverage, degradation, journal size | — |
compact | community | Retention policy: how much .ragraf takes up and what can be removed | apply, vacuum, retain |
note | community | P2-3. Recording a note about a decision: short knowledge between sessions | text, task, tags, path |
notes | community | P2-3. Reading notes: by task and/or by a substring of the text | task, query, limit |
task_set | community | P3-3. Naming the current task (RAGRAF_TASK without a client) | name, clear |
task_stats | community | P3-2 (§3.4). Report line for a task: what the work was evidenced by | task, fmt, limit |
fact_store | pro | Storing a fact with a key, a version and a lifetime; a second live record for the same key is refused | subject, predicate, value, namespace, confidence, ttl_days, tags, path, task |
fact_recall | pro | Reading facts by substring, namespace or tags; expired ones only on an explicit request | query, namespace, tags, include_expired, limit |
fact_replace | pro | Replacing a fact's value: a new version, the previous one kept in history with its reason | fact_id, value, reason, confidence, ttl_days |
fact_forget | pro | Forgetting a fact: a tombstone and a reason in the notes journal, the record itself is not deleted | fact_id, reason |
fact_history | pro | All versions of a fact: replacements and the tombstone, each with its reason | fact_id |
What it does not show. Service operations change the state of the store, not the knowledge about the code: compact does not make the index fresher.
External contours #
The team's shared index, the secret broker, single sign-on, export to SIEM, attestation, the offline licence, contract pinning.
| Operation | Edition | What it answers | Parameters |
|---|---|---|---|
shared_index_status | pro | State of the corpus publication: whether it is open for reading and who is admitted | — |
shared_index_publish | pro | Open or close the corpus publication, or change a client's admission | action, label, port, note |
shared_index_query | pro | Put a question to a published index at its address | operation, params, url, timeout |
broker_issue | pro | Issuing a secret on request: a lease with a term, a grantor and a reason | secret, agent, ttl_minutes, reason |
broker_rotate | pro | Scheduled rotation of the value: status | plan | run | secret, mode, every_days, value |
sso_login | enterprise | OIDC sign-in: exchanging the authorisation code and verifying the id_token | code, state, provider, redirect_uri |
sso_map_roles | enterprise | Mapping groups of the external directory onto panel roles | groups |
siem_export | enterprise | Exporting journals to an external SIEM after a cursor | source, limit, dry_run |
siem_test | enterprise | A trial delivery to the SIEM receiver | — |
attest_bundle | enterprise | Attesting a delivery: assemble a signed bundle or verify a ready one | verify, out, bundle, tree |
license_offline | enterprise | Offline licence for a closed contour: request, issue, acceptance, transfer | mode, request, license, out |
contract_pin_status | enterprise | Pinning of operation signatures: what is confirmed, what has diverged | limit |
contract_pin_approve | enterprise | Confirm the current description of an operation (or of all of them) by a human | op, everything, by, note |
contract_pin_history | enterprise | History of the pinned set: who changed it, when, and from which hash to which, with a summary by author and by object | kind, op, limit |
contract_pin_sample | enterprise | Behaviour probe: what an operation actually returns, hashed without the volatile fields — the part a signature pin cannot see | mode, op, limit, by |
contract_drift | enterprise | Reconciling intent and code by FQN: modules, dependencies, contracts | manifest_path, source |
contract_diff | enterprise | Changes to the contract between two releases: what appeared, what disappeared and what changed, with breaking and compatible kept apart | before, after |
What it does not show. Contours need their own configuration (keys, certificates, shared directories); without it the operation refuses with an edition or license kind, rather than "working halfway".
<!-- why-operations:begin -->
Why each operation exists #
The tables above say what an operation answers. This section says what problem it was created for, and how the answer is assembled. Every reason is taken from the operation's own source — the docstring of its method, or the delivery document named beside the operation — and none was written to fill a gap: where the source says nothing, the operation page says so instead of inventing a story.
The third column is read from the code and uses the same four words everywhere: licence gate is the edition check that runs before any work, index revision the revision every fact is tied to, no index a refusal when the index is missing, computation a body that answers on its own. What follows a step is the module function the body calls. stores: names the store it reads, and adds: the fields it writes into the answer envelope.
Navigation and reading #
| Operation | Why it exists | How it works |
|---|---|---|
search | Search is how a reader enters a corpus it has not read: it answers where a concept lives without loading files. Since the rev-0030 measurement the hit itself can carry snippet, the beginning of the chunk text FROM THE INDEX, because before that the text of a hit cost a second call: twenty hits cost twenty file reads. | index revision → formats_mod.group_of_material · adds: code_candidate, material_mix, snippet_width |
search_multi | The same text lives in a project in ten places: Allowed formats is eight copies of php/Wizard/Files*.php, upload.php and templates/Files.html. An agent searched them one query at a time, two to four calls, and still did not know which file is LIVE and which is a copy — that took a separate reading of the JavaScript. | index revision · adds: grouping, suggest |
symbol | A name seen in a search hit is not yet a definition. This operation returns the node or nodes behind that name: kind, file, line range, signature and who declared it. | index revision · adds: suggest |
references | 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). | index revision → evidence_mod.classify → evidence_mod.how_of · adds: evidence, suggest |
code | Bodies are returned only on an explicit request, so a search never spends context on code nobody asked for. | index revision · adds: gaps, nested_dropped, resolved |
live_read | The index stores chunks, not whole files, so a line-by-line difference against it cannot exist; the difference is stated as changed_since_index by sha256. The context parameter used to be accepted and influenced nothing, and a measurement on 28.10.2026 found it the only empty promise in the surface declared at that time, so it was removed rather than left declared. | index revision · adds: extract_kind, extract_note, in_index |
neighbors | search answers only inside the current corpus, and route says where material lies without reading it, so a function that already works in a neighbouring project on the same stack was written again: the agent could not learn that it exists. Here the search runs over the indexes of NEIGHBOURING corpora, chosen by the stack they actually use. | index revision → neighbors_mod.find → neighbors_mod.lang_profile · adds: note, suggest |
route | Answering "where does this material live" needs no file contents and no quotations, so the operation reads neither. Its answer is candidates with the reason they were chosen, plus what the local index knows. | computation · adds: note, suggest |
freshness | The point of the operation is a direct answer to one question: can the facts be trusted right now. It compares the corpus checksum with the code, and with force=true it skips the cache, which is what is needed right after an edit to confirm that reindexing actually happened. | watch_mod.check |
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. | index revision · adds: budget_ok |
catalog | The answer to "are the projects separate" is not a matter of belief: each entry has its own root, its own revision and its own checksum. Projects are physically separated by .ragraf directories, and the registry only gives the summary view over them. | computation · adds: note, suggest |
Code graph #
| Operation | Why it exists | How it works |
|---|---|---|
callers | Before changing a function, the question is who depends on it, and a list of names is not enough: a binding by name and a call resolved by full name are different strengths of evidence. Stage 10 made the confidence threshold an argument of this call, and the answer names the default it used when the argument is absent. | computation |
callees | The mirror of callers: what a function calls, so a change can be followed downwards before it is made. The confidence threshold is an argument of the call (stage 10), which keeps this answer and callers judged by the same rule. | computation |
impact | A change is not safe because the file compiles: it touches files, symbols, tables, routes and tests that are known through edges of different strength. The operation answers what will be affected and keeps proven links apart from heuristic ones, so "affected" is readable as fact or as conclusion. | index revision → evidence_mod.summarize · adds: suggest, target_external |
slice | A structural slice gives the nodes, lines and edges around a symbol without the bodies of functions, which is what makes it cheap enough to hand to a model. It is the answer to "what is connected to this" when the text itself is not wanted. | index revision → evidence_mod.summarize · adds: capability, capability_reason, next_action |
edge_evidence | callers and callees answer who and whom, but the proof there is one field among many, and the question "why does the index believe this link exists" needs its source. | index revision → evidence_mod.classify → evidence_mod.how_of · adds: suggest |
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. | index revision · adds: note, regressions, suggest |
Documents #
| Operation | Why it exists | How it works |
|---|---|---|
doc_search | A document answer is only usable if it can be checked, and checking needs the address of the chunk and the status of extraction, not just text. search --kind doc looks through all chunks, while a document address lives in document_chunk; here one batch query returns the address, the structure and the extraction status — the facts trust is judged by. | index revision · adds: evidence, suggest |
doc_get | Order matters here. The index is asked first: it answers fast and belongs to the same revision as the other facts. | index revision · adds: evidence, resolved, suggest |
doc_status | The document layer reports its own condition: statuses, reasons and budgets in one answer. It also names the chunks whose vector covers only part of the text (vector_partial), because staying silent would claim that the vector describes the whole chunk. | index revision |
doc_validate | Chunking is checked as a verdict, not as an impression: the answer carries ok and a list of violations with the number of the rule broken. A failure is not an exception — the operation has to name which rule was broken at which address, otherwise "the index is bad" leaves nothing to fix. | index revision · adds: problems |
doc_search_levels | This is a separate operation rather than one more mode of search, because search already has a contract: a flat list of hits, the one-answer mode, material and document role, staleness marks. | index revision → docgraph_ops.layer_state → docgraph_ops.locator · adds: degraded, refused, suggest |
doc_ocr | The capability is declared by the Pro edition (doc-ocr), so on Community the call is refused by the edition layer with a reason BEFORE the engine is checked — which keeps "not licensed" and "no engine" as different answers. One operation covers both the state of the capability and the decision for a given file, because a second call would add no fact. | computation |
entity_neighbors | An entity taken out of its context is a name, not a fact. This operation returns its neighbours in the document graph, each with the address of the citation that connects it. | index revision → docgraph_ops.entity_neighbors · adds: limits_declared, suggest |
doc_relations | Two documents that mention the same entity are related, and the relation is only usable when both sides have an address. Exactly one input is accepted (doc or entity): both at once is a call error rather than "the first one was taken", because the two inputs mean different answers. | index revision → docgraph_ops.doc_relations · adds: limits_declared, suggest |
themes | A theme is a group of entities that occur together more often than chance (themes.build). The clusters are deterministic: the same layer gives the same theme_id on any machine, so themes are comparable between revisions. | index revision → themes_mod.describe_degraded → themes_mod.read · adds: degraded, limits_declared |
global_overview | The question here is not "what was found" but "what exists at all": documents, entities, relations, themes, summaries and the leading themes with their addresses. Each theme arrives with citations, so the map can be verified rather than believed. | index revision → themes_mod.describe_degraded → themes_mod.overview · adds: degraded, limits_declared |
Provenance and staleness #
| Operation | Why it exists | How it works |
|---|---|---|
doc_asof | The date filter is the same chunk selection plus one condition on the document version, so it runs through doc_search instead of a second search path. A second path would diverge from the first on the first edit — ranking, trimming, the shape of the answer — and "two operations search differently" would become a defect visible only by comparison. | index revision · adds: suggest |
dependents | A fact that other facts rest on cannot be changed alone. The input is the identifier of a fact or its address (path:lines), and the walk is breadth-first to depth (three by default). | index revision · adds: counts, suggest |
stale_cascade | The difference from dependents is in the question, not in the walk: there it is "what depends on one fact", here it is "what has to be recomputed when this set changed", with marks and their closing. There are three kinds of call and one per call: apply writes marks, clear closes them after recomputation, and an empty changed reads what is already marked. | index revision · adds: counts, next_action, suggest |
Index quality #
| Operation | Why it exists | How it works |
|---|---|---|
quality_trace | The suite answers whether a case fails and keeps no record of HOW it failed: the step log lives its own life and the case declaration is edited. Here a failure is stored so it can be repeated a week later — the whole case declaration, the steps, the gate decisions and the revision. | licence gate → index revision → cases_mod.evaluate_one → cases_mod.gate_decisions · adds: counts, next_action, saved |
quality_suite | The question "can this index be trusted" used to be answered by the numbers in index_status.quality, which could not be SAVED and compared with the previous run: every call computed afresh and showed only the current figure. So "worse after the edit" was found by eye, and a truncated signature or an oversize chunk was found by accident. | licence gate → index revision → quality_mod.run · adds: cases, checks, findings |
quality_diff | A difference between revisions is not an index defect. When the two runs were made on different revisions the answer carries through_revision: true and verdict: null: an edit legitimately changes the numbers, and calling that a degradation would blame the index for the programmer's work. | licence gate → quality_mod.diff · adds: suggest, through_revision, verdict |
quality_pair | quality_diff compares the NUMBERS of the index and deliberately gives no verdict between revisions. This operation asks a different question and its verdict is mandatory: is the same fixed set of questions answered worse or better. | licence gate → quality_mod.pair_runs · adds: pair_basis, regressions, same_state |
quality_prune | The limit QUALITY_RUN_SOFT_LIMIT has been declared for a long time, but deleting old runs is irreversible and the decision belongs to a person: automatic rotation would erase the very evidence used to argue that something got worse. So the default is a dry run, nothing is deleted without confirm, and a copy of the journal is taken before any deletion. | licence gate → quality_mod.prune · adds: backup, deleted, dry_run |
gate | The gate is installed by the DSH PreToolUse hook and receives tool_name, tool_input, cwd and session_id. The operation returns the same decision as the hook and records it in the gate state, because a "gate check" that disagreed with what the gate does would be worthless. | gate_mod.handle_payload → gate_mod.state · adds: verdict |
calibrate | Confidence thresholds are numbers the index uses to decide what counts as a link, so they have to be recomputed when the corpus or the parser changes rather than left at the values they were shipped with. This operation recomputes thresholds and confidence levels and records them in calibration. | computation |
Corpus structure #
| Operation | Why it exists | How it works |
|---|---|---|
duplicates | Files.php … Files7.php and import.pl / import1.pl / import2.pl are copies that diverged through edits. The standard collapse in dedupe.py does not see them: it compares sha256 and serves the corpus checksum, not a human answer. | index revision · adds: files_checked, groups_total, suggest |
entrypoints | The question "which files actually run and which lie dead" is asked first on real projects: next to the working import.pl sit import1.pl, import2.pl and import_stdin.pl, and next to Files7.php sit six of its copies. That used to be settled by reading listings and JavaScript by hand. | index revision · adds: evidence, suggest |
dead_code | A verdict of "dead" is expensive to get wrong, so it is pronounced only when TWO independent checks agree: no incoming edges in the graph AND no literal mention of the path in the text of other files. Files that are themselves entry points — a script with a shebang — are never called dead, because a runnable scenario is supposed to have no incoming references. | index revision · adds: candidates, checked, evidence |
excludes | Switching a profile changes the COMPOSITION of the corpus, so "just skip temp" is a promise that has to be checked, not only configured. | excludes_mod.describe → excludes_mod.impact · adds: next, note, source |
preflight | Indexing time used to be learned after the fact, and the blind spots — dynamic calls like $obj->$method() and getattr — were learned from wrong answers after the build. Here the answer is given before anything is created, and the operation creates NOTHING: no .ragraf, no directory, no file. | licence gate → preflight_mod.scan · adds: code_files, dynamic_spots, estimated_total_ms |
drift_report | An index and the code drift apart silently: files are edited, symbols move and edges point at what is no longer there. This operation reads the drift ledger — the files, symbols and affected edges — and the session-start hook reads the whole ledger, so the discrepancies are taken into account before any conclusion is drawn (docs/02_architecture/ARCHITECTURE.md:631). | index revision · adds: suggest, summary |
drift_ack | A drift record is not deleted when it is accepted: accepting means appending an acknowledgement, so the history of what was known, and when, survives. That is why the operation writes an ack and never removes the entry. | computation · adds: note |
Databases #
| Operation | Why it exists | How it works |
|---|---|---|
schema | A column's properties are returned as separate fields rather than as one column_key string, because decisions about writing are taken from them (write_check), and "a string every reader parses itself" had already produced a measured defect: a column was taken for a generated one because of the substring GENERATED. | index revision · adds: columns_total, generated_total, live_databases |
db_schema | The source here is the live database, not the migrations. A disagreement with schema — which reads migrations — is itself a finding: it shows that the migrations and the database have parted. | index revision → db_ops.schema → db_ops.summary |
db_table | One table answered in full: columns, indexes, keys, relations and hidden fields. It is the detailed view that a schema listing cannot give, and the one a change to a single table starts from. | index revision → db_ops.table_detail |
db_relations | A relation declared by a foreign key and a relation inferred from column names are not the same fact, and mixing them would make an inference look like a constraint. The answer keeps stated and derived apart, so a reader knows which one a join can rely on. | index revision → db_ops.relations · adds: evidence, note |
db_sample | A sample of rows answers what a type declaration cannot: what the values actually look like. The answer comes with its provenance and a mark of concealment, so rows can be read and quoted without losing the fact that they are a snapshot of a live table. | index revision → db_ops.sample |
db_drift | Two different questions are answered together, and neither replaces the other: drift is what changed in the LIVE database between two index revisions, and migrations_vs_live is which tables and columns the migrations describe but the live database does not have, and the other way round. | index revision → db_ops.drift → db_ops.migrations_vs_live · adds: live_only, migrations_only, note |
db_cross | Table names taken from the code arrive with proofs: @table: edges are a fact of language parsing (name, access kind, path:line), while a textual SQL sample is a heuristic for corpora without edges. Mixing them silently is not allowed, so every name carries its source. | index revision → db_ops.cross_check · adds: used_sources |
table_usage | The answer to "where exactly is the insert" needs the access kind kept, not computed at extraction and thrown away: every fact carries write and access (select, insert, update, delete, ddl). | index revision · adds: note, schema_source, suggest |
write_check | Defect number 7 on the range: the code wrote into columns AuthorUserID and UpdatedBy that the journal tables do not have (they have InitiatorID, and UpdatedBy exists in one table only). The driver error 42S22 surfaced at the first save — that is, after the code was written and run. | index revision → db_ops.schema · adds: problem, problems, similar_tables |
policy_trace | The most expensive defect on the range (number 9 in the development report) was found only by testing under a real role: role employee received the rights approve, mark_paid, sign and archive, because a switch branch returned true for everyone holding a journal. No navigation measurement shows this, and the eye loses it inside a large switch. | index revision → evidence_mod.summarize · adds: evidence, fail_closed, note |
class_usage | A styling class is the object most often checked when editing an interface: does the style exist, where else is it used, will a button be left unstyled. Without this operation an agent searches class names as text and misses the mismatches. | index revision · adds: suggest |
routes | The registry is filled during indexing by the PHP, HTML and JavaScript extractors, and the kind of entry point is named in the field kind: route is registered in code (Route::post('/x')), endpoint is a file mentioned as an address (action=, src=, fetch(...), a server-side include). These are different degrees of trust, and putting them in one list without a mark would merge them. | index revision · adds: by_kind, suggest |
Corpus administration #
| Operation | Why it exists | How it works |
|---|---|---|
index_status | The full calculation costs a measured 4 630 ms: graph_compute_state loads torch (2 401 ms just to import) and computes PageRank over the graph, and the quality part reads a sample of vectors. | index revision · adds: counts |
compact | The operation that changes the disk must first name the numbers, so the default is a plan only and the decision stays with the caller. apply=True removes the tail of the rotation, CPG artefacts outside the storage and temporary files, then runs VACUUM where that is justified. | storage_mod.apply → storage_mod.plan · adds: next, suggest |
note | What one session discovers — "in this database some columns are generated, you cannot write to them" — is reopened from scratch by the next one, because the knowledge lives only in the conversation. A note is kept in the control store of the corpus, next to the journal and the revisions, and never enters the code index. | index revision · adds: note_count |
notes | Notes are the knowledge that lives between sessions: note writes one, and this operation reads them back by task, by a substring of the text, or by both. What comes back is not a fact of the code — the index does not verify it — so every record carries its author, its time and its task, and the field source says note. | computation · adds: note, source, suggest |
task_set | A RAGRAF_TASK variable is set at the START of a process, and a client starts the MCP server once per session, so the task cannot be named in its environment later. Therefore the agent names it with one call, and the state is shared between processes — the MCP server, the CLI and the hook all read it — so one named task collects every access to the index, whichever way it comes. | gate_mod.state → gate_mod.state_path · adds: note |
task_stats | A report of what confirmed the work is assembled from three independent sources, and it names them: the access journal (telemetry), the gate state (decisions on tool calls) and the notes. If a task had no calls at all, the report says so with the number 0 instead of staying silent, because "zero calls" is a finding, not a lack of data. | index revision → gate_mod.state · adds: note |
External contours #
| Operation | Why it exists | How it works |
|---|---|---|
shared_index_status | Publishing a corpus outside the machine is a decision that must be visible before it is used, so the state is readable on its own: whether the corpus is open for reading and who is allowed in. It reads only the tables pro_share and pro_share_acl of the own corpus, and no path of this machine leaves it: the answer is names, dates and a binding address, not files. | licence gate · adds: acl_count, allowed_operations, published |
shared_index_publish | Opening an index outwards and granting a client access are different decisions of the owner, and one must not follow from the other, so action separates them: open, close, grant, revoke. | licence gate · adds: acl_count, published |
shared_index_query | The access token is read ONLY from the environment variable RAGRAF_SHARE_TOKEN, never from a parameter: a parameter lands in the access journal (as a digest of the primary argument), and a secret must not end up there. | licence gate · adds: local_freshness, refused, remote |
broker_issue | A secret handed out has to be tied to a reason and a term, otherwise the vault turns into a list of values. | licence gate → broker_mod.issue · adds: lease_id, lease_state, redeemed |
broker_rotate | A value scheduled for change needs a state, a plan and an execution, and they are different jobs: status says what is scheduled, what is overdue and how many leases are active, without writing anything; plan sets the date for a record; run changes the value now. | licence gate → broker_mod.rotate · adds: mode, overdue, planned |
sso_login | The login exchanges an authorization code and verifies the id_token: the signature against the provider's JWKS, then the claims iss, aud, exp, nonce and the presence of sub. Roles are taken ONLY from the mapped groups in sso_group_roles; a role claim placed directly in the token is not read, because otherwise rights would arrive from the client. | licence gate → sso_mod.config_from_settings → sso_mod.login · adds: suggest |
sso_map_roles | The operation needs no network: it answers which rights a group will give BEFORE the login is switched on. Without it the mapping would be tested by an attempt to log in — that is, blind — and a mistake in the configuration would look like "the provider did not let us in". | licence gate → sso_mod.config_from_settings → sso_mod.map_roles · adds: note, suggest |
siem_export | Only metadata leaves: who, when, operation, result, reason of refusal, duration. Values of secrets are never exported, and the free text detail of the access journal is not exported at all — "we hope there is no secret in it" is not a proof. | licence gate → siem_mod.export · adds: suggest |
siem_test | "The export ran" and "the receiver accepts us" are different statements, so the trial delivery is a separate operation. The probe does not move the cursor and does not read the journals, so it can be run as often as needed and before the export is switched on. | licence gate → siem_mod.test_delivery |
attest_bundle | Building a set and checking it are one operation with the verify switch, because both answer one question: can this be handed to an auditor. Building a set without being able to verify it would mean issuing evidence without a means of checking it. | licence gate → attest_mod.AttestRefusal → attest_mod.collect · adds: suggest |
license_offline | Four kinds of work in one operation, because they are one contour and one reason for refusal: request names the installation and needs no signing key and no network; issue signs a licence for an installation from a request; accept takes a licence — signature and authorship first, then the fingerprint of the installation, then comparison with the request; transfer is a separate explicit step that requires a new signature. | licence gate → edition_mod.license_path · adds: suggest |
contract_pin_status | The surface of the product is described by data (surface), but nothing watched that a client calls the description it counted on: an edit of a parameter default or a vanished result key looked like "the index lies" rather than "the contract changed". Here the divergence and its age are visible. | licence gate → pin_mod.ensure_schema → pin_mod.status · adds: breaks, mismatches, next_action |
contract_pin_approve | A pin without an author is indistinguishable from self-signing, and the whole point of a pin is that someone said "I accept this description". So the author is mandatory, and the approval is a separate decision rather than a side effect of reading the state. | licence gate → pin_mod.approve · adds: approved, next_action, suggest |
contract_drift | Intent lives OUTSIDE the code, in an external YAML manifest of the project, and here it is compared with the computed graph. The operation only reads: the manifest is written by the project, and RAGRAF neither creates nor edits it. | licence gate → index revision → anchors_mod.load → contracts_mod.analyze · adds: anchors, binds, declared |
contract_pin_sample | A pin sees the shape: the name, the parameters with their defaults, the keys of the answer. An edit that keeps the shape but changes the result is invisible to it, which was stated in section 6 of the document and checked by nothing. | licence gate → pin_mod.accept → pin_mod.changed_ops · adds: changed, next_action, not_sampled |
contract_pin_history | contract_pin_status names the LAST change, but not how often the contract was broken this month or by whom: a pin keeps one row per object. Here every change is a row, and a summary by author and by object sits above them. | licence gate → pin_mod.authors → pin_mod.ensure_schema · adds: changes, changes_total, latest |
contract_diff | Two files ops_pins.json, before and after, give a report of what appeared, what disappeared and what changed, with breaking and compatible kept apart. Nowhere does it confirm anything: the decision stays with a person, and the pin is set by contract_pin_approve. | licence gate → diff_mod.diff · adds: breaking, compatible, next_action |
fact_store | A fact recorded twice in two ways is indistinguishable from two facts, so the key is taken once and a change goes through fact_replace, where the reason is asked for. | licence gate → facts_mod.FactStore.store · adds: source, note |
fact_recall | Expired facts are hidden, not deleted, and the answer names how many were hidden — otherwise «the fact disappeared» would look like «the fact was erased». | licence gate → facts_mod.FactStore.recall · adds: expired_hidden, source |
fact_replace | A term that was not passed is not recomputed: editing the text must not silently extend the life of a fact that is about to expire. | licence gate → facts_mod.FactStore.replace · adds: source |
fact_forget | The full history is the only way to explain later why the fact changed, so forgetting is soft: a tombstone, the history and the reason in the notes journal. | licence gate → facts_mod.FactStore.forget · adds: note_error, source |
fact_history | The active version is named separately, so «the history is empty» is not confused with «there is no such fact» — the second one is the refusal fact_not_found. | licence gate → facts_mod.FactStore.history · adds: active_version |
skill_catalog | Instructions cost context, and the price of a skill was learned only after reading it; the catalog names the price before the read. | licence gate → skills_mod.SkillCatalog.catalog · adds: budget_left |
skill_load | Reading a skill whole is exactly the expense this layer exists to avoid, so the body is served page by page with a hash that proves the page came from the file. | licence gate → skills_mod.SkillCatalog.load · adds: sha256, next_offset |
skill_reference | A reference file is half of a skill body, and reading the whole body for one section is the waste the catalog prevents; the jail accepts only a bare file name. | licence gate → skills_mod.SkillCatalog.read_reference |
<!-- why-operations:end -->
Example call #
Both forms reach the same code — the CLI and MCP do not diverge. The measurement below was taken on this site's corpus (revision rev-0013), not rewritten from the documentation:
python tools/ragraf.py -p config/site.yaml query search "locale switcher" --limit 3{"op": "search", "index_rev": "rev-0013", "capability": "full", "found": true,
"limits": ["static analysis; runtime values are not covered"],
"result": [{"path": "languages/site-ru_RU.php", "start_line": 111, "end_line": 230,
"score": 11.1111, "why": "matched on: lexical", "source_kind": "file"}],
"freshness": {"rev_id": "rev-0013", "stale": false, "verified_by": "fingerprint"}}The same call through the MCP tool:
ragraf_search(query="locale switcher", limit=3)The full list of tools, with "read-only / changes state" hints, is on the "MCP tools reference" page.
What is not in the list #
Operations that are not in the code are not here — and none of them says "coming soon". If a capability is announced but its code is missing from your build, the operation refuses with a feature kind instead of returning an empty result. To check your build: python tools/ragraf.py edition.