Repository navigation
op task_stats
Report line for a task: what the work was evidenced by.
| Group | Corpus administration |
| Edition | community — works without a licence |
| Capability |
audit — the feature that carries this operation; the licence matrix is on 15 · Editions and licensing
|
| MCP tool |
ragraf_task_stats · read-only · idempotent |
| CLI | ragraf -p <config> query 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.
- Report how the work on a task was confirmed.
- See the calls, the facts and the gate decisions of one task together.
- Read a zero as a finding rather than as an empty report.
The call that produced the answer below, as a command line:
$ ragraf -p demo-corpus.yaml query task_stats
The same call through MCP: ragraf_task_stats().
The answer below was captured on the demo corpus, not written for the page:
{
"op": "task_stats",
"index_rev": "rev-0002",
"capability": "degraded",
"provenance": "index",
"found": true,
"result": {
"task": "",
"figures": {
"task": "",
"calls": 181,
"calls_with_facts": 94,
"facts": 907,
"hit_rate": 0.5193,
"saved_calls": 22,
"stale_served": 3,
"misses": 66,
"avg_ms": 190.03,
"by_op": [
"... 38 more"
],
"by_task": [],
"notes": 0,
"gate": {
"counters": {},
"decisions_for_task": 21,
"ask": 0,
"deny": 0,
"sessions": 2,
"write_failures": 0
}
}
},
"limits_count": 1
}The call succeeded. The answer is trimmed to two items per list and to the fields that carry no Russian prose: limits and the explanatory strings are counted in the footer below instead of being quoted.
| Name | Type | Default |
|---|---|---|
task |
str | None |
None |
fmt |
str |
'markdown' |
limit |
int |
10 |
Result keys visible in the code: figures, markdown, report, task.
The body also writes these fields into the answer envelope itself (extra): note.
The envelope around the result is the same for every operation; how to read it: 04 · Operations reference.
| Step | What happens |
|---|---|
| Reads | none of the three stores directly — the answer comes through the engine the body calls, or from what the call is given |
| Calls | gate_mod.state |
| Guarded by | the index revision is read (current_rev), so every fact belongs to a named revision |
| Writes |
note into the answer envelope |
| Empty answer | yes |
flowchart TD
Start[query task_stats]
Rev{index revision}
NoIndex[refused: no index]
Call0[gate_mod.state]
Found{found}
Empty[empty result]
Out[envelope with result]
Start --> Rev
Rev -- none --> NoIndex
Rev -- rev-N --> Call0
Call0 --> Found
Found -- no --> Empty
Found -- yes --> Out
Every answer carries a limits field, and it is never empty when a boundary exists: that is where the limits of this particular call are named — which part of the corpus was not covered, which fact could not be confirmed, what the operation refused to guess.
The boundary of the whole Corpus administration group is stated once, on the reference page. It is a sentence about the group, so it is not repeated here as if it were a sentence about task_stats.
← previous in the group: task_set
→ next in the group: fact_store
The full table with all 87 operations · A–Z index · Corpus administration
Where these fields come from: the parameters, their types and defaults are read from the signature op_task_stats in src/ragraf/facade.py:5959 (line numbers as of 0.12.0); the MCP annotations from the tool registration; the edition from src/ragraf/edition_baseline.json; the guards, calls, stores, envelope fields and the diagram from the body of that same method. The example is a run of tools/build-op-examples.py on the demo corpus at revision rev-0002; fields whose value is Russian prose in this build (limits, explanatory strings) are counted, not quoted. Nothing else on this page is written by hand.
The reason and the tasks above are a translation of the docstring of op_task_stats, src/ragraf/facade.py:5959, kept in tools/op-text.json next to the line it came from. That file is the only hand-written text in the pipeline; the gate tools/check-op-text.py checks that the line exists and that its text is English.