Skip to content
RAGRAF

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:

FieldWhat it means
opwhich operation answered
index_revwhich index revision supplied the facts
capabilityfull, text-only or degraded — what was built in this revision
edition, featureswhich edition is in force and which capabilities are open
driftdivergence between the index and the code at the moment of the answer
provenancewhere the fact came from: index, graph or database
limitswhat the operation does not show — never empty when a boundary exists
stale_warningswhich facts went stale, and why
foundwhether an answer was found at all
resultthe 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).

Answering a question about the code without reading whole files. Also the state of the corpus: freshness, the map, the registry.

OperationEditionWhat it answersParameters
searchcommunityHybrid search: lexis + vectors (RRF), every hit with its provenancequery, limit, kinds, with_text
search_multicommunity1a. Search "in one answer": several queries, copies, encodings (P1-1)queries, limit, scope, regex
symbolcommunityA symbol: kind, file, lines, signaturename, path, limit, answer
referencescommunityEvery place a symbol is usedfqn, limit, min_confidence
codecommunitySymbol bodies — only on an explicit requestfqn, path, style, limit
live_readcommunityReading the current file, highlighting what differs from the index (FT-31)path, start, end
neighborscommunityNeighbouring contours: a ready implementation of the same stackquery, name, limit, per_corpus
routecommunityThe route: where the material lives and which local index answersquery, limit, verify
freshnesscommunityIndex freshness: whether the corpus checksum matches the codeforce, auto_reindex
repo_mapcommunityRepository map: modules → files → key symbols, within a token budgetscope, budget_tokens, detail
catalogcommunityRegistry of projects: what is indexed, when, with which checksums—
skill_catalogproWhich skills the corpus carries and what reading each one costs, before any body is read—
skill_loadproThe skill body page by page, with sha256 and next_offset; next_offset=0 means there is no continuationname, offset, limit
skill_referenceproA reference/<name>.md file of a skill by name; anything with a directory in it is refused with path_jailname, 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.

OperationEditionWhat it answersParameters
callerscommunityWho calls itfqn, depth, hard_only, limit
calleescommunityWhat it calls (the confidence threshold is a parameter, stage 10)fqn, depth, hard_only, limit
impactcommunityWhat a change will touch. Proven and heuristic links kept apart (FT-18)target, mode, depth, limit
slicecommunityStructural slice: nodes + edges + lines, WITHOUT function bodies (FT-19)fqn, direction, limit, min_confidence
edge_evidencecommunityA function's edges with their evidence: kind, how it was bound, coordinatefqn, kind, limit
diffcommunityP2-1. What changed between revisions: files, symbols, edges, regressionssince, 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.

OperationEditionWhat it answersParameters
doc_searchcommunitySearch across document chunks: the fact, its address, its provenancequery, limit, kind, doc
doc_getcommunityText by document address, with provenance: from the index or from disklocator, with_provenance, asof
doc_statuscommunityState of the document layer: statuses, reasons, budgetsdoc_id
doc_validatecommunityChecking the integrity of the chunking: a verdict, not an impressiondoc_id
doc_search_levelscommunityDual-level search: local facts and the global level in one answerquery, limit, mode
doc_ocrproState of the OCR capability and the decision for one particular filepath
entity_neighborsproAn entity's neighbours in the document graph: each with the address of its citationentity, depth, kind, limit
doc_relationsproDocument links through shared entities: addresses on both sidesdoc, entity, limit, asof
themesproThemes of the document graph: participants, addresses and a summary, where one existsscope, limit
global_overviewproMap of the document graph: how much of what, and which themes dominatelimit

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.

OperationEditionWhat it answersParameters
doc_asofproSearch across documents valid on a date (the validity interval)query, date, limit, kind
dependentsproWhat relied on a fact: direct and transitive dependencies along the edgesfact, locator, depth, include_stated
stale_cascadeproWhat to recompute after the inputs change: a cascade along fact → fact edgeschanged, 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.

OperationEditionWhat it answersParameters
quality_traceproTrace of a confirmed failure: record it, show it, replay itaction, case_id, trace_id, session
quality_suiteproIndex check suite: chunk size, signatures, vector, mode, breakdownlabel, record, session
quality_diffproBreakdown of the divergences between two quality runsfrom_run, to_run
quality_pairproPaired run: the same fixed cases, two runs, a verdict per casefrom_run, to_run
quality_pruneproThinning the quality-run journal: a copy, a confirmation, entry numberskeep, dry_run, confirm
gatecommunityP3-1 (§3.2). Gate decision on a tool call: allow / ask / denypayload, mode
calibratecommunityThreshold 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.

OperationEditionWhat it answersParameters
duplicatescommunity12b. File copies: "one name with numbers" groups and byte-identical ones (P1-2)scope, limit
entrypointscommunity12a. Entry points and file reachability (P1-2)path, scope, limit
dead_codecommunity12c. Files and routines with no references and outside reachability (P1-2)scope, limit
excludesproP2-4. Profile of "noisy" directories: what is excluded and what that costsaction, dirs, force
preflightproPrice and boundaries BEFORE indexing: what it will cost and what will not be coveredroot, sample
drift_reportcommunityJournal of divergencessince, limit
drift_ackcommunityAcknowledging 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.

OperationEditionWhat it answersParameters
schemacommunityDatabase schema from the project's migrations (M2, P1-4)table, limit
db_schemacommunityStructure of the live databases: tables, columns, types, indexestable, database, limit
db_tablecommunityOne table in detail: columns, indexes, relations, hidden fieldstable, database
db_relationscommunityTable relations: declared and inferred from names, kept separatetable
db_samplecommunitySample rows of a table: a snapshot marked with its stalenesstable, database
db_driftcommunityWhat changed: between revisions AND between migrations and the database (P1-4)previous_rev
db_crosscommunity"Code ↔ database" reconciliation: what does not match and who does what—
table_usagecommunityWho reads a table and who writes it (U4, U5)table, limit, mode
write_checkcommunityChecking the write plan against the schema BEFORE execution (U1)table, columns, operation, values
policy_tracecommunityTracing decisions about permissions (U6)symbol, action, depth, limit
class_usagecommunityPresentation classes: where each is defined, where used, what divergesname, limit, mode
routescommunityRoutes 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.

OperationEditionWhat it answersParameters
index_statuscommunityRevision state, coverage, degradation, journal size—
compactcommunityRetention policy: how much .ragraf takes up and what can be removedapply, vacuum, retain
notecommunityP2-3. Recording a note about a decision: short knowledge between sessionstext, task, tags, path
notescommunityP2-3. Reading notes: by task and/or by a substring of the texttask, query, limit
task_setcommunityP3-3. Naming the current task (RAGRAF_TASK without a client)name, clear
task_statscommunityP3-2 (§3.4). Report line for a task: what the work was evidenced bytask, fmt, limit
fact_storeproStoring a fact with a key, a version and a lifetime; a second live record for the same key is refusedsubject, predicate, value, namespace, confidence, ttl_days, tags, path, task
fact_recallproReading facts by substring, namespace or tags; expired ones only on an explicit requestquery, namespace, tags, include_expired, limit
fact_replaceproReplacing a fact's value: a new version, the previous one kept in history with its reasonfact_id, value, reason, confidence, ttl_days
fact_forgetproForgetting a fact: a tombstone and a reason in the notes journal, the record itself is not deletedfact_id, reason
fact_historyproAll versions of a fact: replacements and the tombstone, each with its reasonfact_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.

OperationEditionWhat it answersParameters
shared_index_statusproState of the corpus publication: whether it is open for reading and who is admitted—
shared_index_publishproOpen or close the corpus publication, or change a client's admissionaction, label, port, note
shared_index_queryproPut a question to a published index at its addressoperation, params, url, timeout
broker_issueproIssuing a secret on request: a lease with a term, a grantor and a reasonsecret, agent, ttl_minutes, reason
broker_rotateproScheduled rotation of the value: status | plan | runsecret, mode, every_days, value
sso_loginenterpriseOIDC sign-in: exchanging the authorisation code and verifying the id_tokencode, state, provider, redirect_uri
sso_map_rolesenterpriseMapping groups of the external directory onto panel rolesgroups
siem_exportenterpriseExporting journals to an external SIEM after a cursorsource, limit, dry_run
siem_testenterpriseA trial delivery to the SIEM receiver—
attest_bundleenterpriseAttesting a delivery: assemble a signed bundle or verify a ready oneverify, out, bundle, tree
license_offlineenterpriseOffline licence for a closed contour: request, issue, acceptance, transfermode, request, license, out
contract_pin_statusenterprisePinning of operation signatures: what is confirmed, what has divergedlimit
contract_pin_approveenterpriseConfirm the current description of an operation (or of all of them) by a humanop, everything, by, note
contract_pin_historyenterpriseHistory of the pinned set: who changed it, when, and from which hash to which, with a summary by author and by objectkind, op, limit
contract_pin_sampleenterpriseBehaviour probe: what an operation actually returns, hashed without the volatile fields — the part a signature pin cannot seemode, op, limit, by
contract_driftenterpriseReconciling intent and code by FQN: modules, dependencies, contractsmanifest_path, source
contract_diffenterpriseChanges to the contract between two releases: what appeared, what disappeared and what changed, with breaking and compatible kept apartbefore, 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.

OperationWhy it existsHow it works
searchSearch 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_multiThe 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
symbolA 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
referencesThe 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
codeBodies 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_readThe 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
neighborssearch 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
routeAnswering "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
freshnessThe 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_mapA 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
catalogThe 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 #

OperationWhy it existsHow it works
callersBefore 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
calleesThe 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
impactA 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
sliceA 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_evidencecallers 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
diffDrift 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 #

OperationWhy it existsHow it works
doc_searchA 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_getOrder 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_statusThe 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_validateChunking 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_levelsThis 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_ocrThe 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_neighborsAn 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_relationsTwo 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
themesA 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_overviewThe 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 #

OperationWhy it existsHow it works
doc_asofThe 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
dependentsA 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_cascadeThe 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 #

OperationWhy it existsHow it works
quality_traceThe 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_suiteThe 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_diffA 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_pairquality_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_pruneThe 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
gateThe 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
calibrateConfidence 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 #

OperationWhy it existsHow it works
duplicatesFiles.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
entrypointsThe 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_codeA 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
excludesSwitching 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
preflightIndexing 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_reportAn 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_ackA 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 #

OperationWhy it existsHow it works
schemaA 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_schemaThe 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_tableOne 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_relationsA 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_sampleA 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_driftTwo 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_crossTable 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_usageThe 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_checkDefect 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_traceThe 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_usageA 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
routesThe 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 #

OperationWhy it existsHow it works
index_statusThe 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
compactThe 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
noteWhat 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
notesNotes 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_setA 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_statsA 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 #

OperationWhy it existsHow it works
shared_index_statusPublishing 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_publishOpening 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_queryThe 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_issueA 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_rotateA 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_loginThe 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_rolesThe 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_exportOnly 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_bundleBuilding 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_offlineFour 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_statusThe 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_approveA 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_driftIntent 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_sampleA 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_historycontract_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_diffTwo 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_storeA 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_recallExpired 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_replaceA 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_forgetThe 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_historyThe 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_catalogInstructions 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_loadReading 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_referenceA 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:

Shell
python tools/ragraf.py -p config/site.yaml query search "locale switcher" --limit 3
JSON
{"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:

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