dhrona
Dhrona measures how agents use their tools and teaches better routes. It reads Ramabana and Leela session history, reports tool use and failures, flags poor routes, and turns reviewed sessions into a library of accepted rounds that any Urai chat can replay as a warm start.
The loop
- Measure —
dhrona-toolsreports calls, failure rate and shell bypasses per tool and per model;dhronascores routes in a session. - Capture —
dhrona-captureturns a finished Ramabana session into an Aidialog review notebook. - Review in Leela — open the notebook, remove detours and sensitive content, keep the route future models should imitate.
- Accept —
dhrona-accept --installrecords the reviewer, the tools used and the model, compiles canonical history, and installs it in the rounds library. - Warm start —
warm_start(tools, model)replays accepted rounds whose recorded calls still bind to the offered tools’ live signatures, best-ranked and same-model rounds first.
Re-run dhrona-tools after a change to see whether tool use moved.
Install
pip install dhrona
Measure tool use
dhrona-tools measures tool use across the Ramabana and Leela histories: calls, failure rate and denials per tool, shell commands that bypass a dedicated tool, and the same split per model. It is the before/after instrument for tool culling.
dhrona-tools --since 2026-09-19
dhrona-tools --json > baselines/tools.json
assess_turn scores observable tool actions. It does not infer quality from the assistant narrative.
turn = {
'prompt': 'Use fossick to research https://github.com/AnswerDotAI/llmdojo',
'activity': [{'tool': 'web_search', 'ok': True, 'args': {'query': 'llmdojo'}}],
}
assessment = assess_turn(turn)
assessment
Findings are route (generic search before FOSSICK), schema (arguments that failed to decode), bypass (a shell command a dedicated tool covers), tool_protocol (command-line usage error), repeat_failure and denial_retry (a refused call repeated instead of a question to the user). Every finding lowers the score by 20 points, including each distinct bypass in a turn, so shelling out for git diff or cat costs points. Run dhrona to assess the default Ramabana history. Pass --session to limit the report to one session.
A refused approval is not a tool failure. Ramabana records it as a failed ask row whose detail starts Denied by human operator and carries the operator’s reason (or the timeout that stood in for one). Dhrona never counts these as schema or repeat_failure; dhrona-tools reports them separately as denials per tool with the top denial_reasons, and assess_history flags denial_retry when the same call is made again in that turn or the next turn of the session without a question to the user in between. The packaged approval-refused seed teaches the alternative: name the refused edit, say nothing changed, and ask once.
Curate a round
Ramabana already records completed turns. Capture reads that archive after the conversation ends. It does not monitor a live process.
ramabana --root /path/to/project
# finish the useful conversation, then quit
dhrona-capture training/github-research.ipynb --session latest
leela training
Open github-research.ipynb in Leela. Remove detours and sensitive content. Keep the route that future models should imitate. Save the notebook, then accept it with a reviewer name.
dhrona-accept training/github-research.ipynb --reviewer Karthik --install
Acceptance updates the notebook metadata with the reviewer, the tools the round calls and the session model, and writes github-research.json as derived canonical history. --install also copies it into the rounds library (~/.config/dhrona/rounds/), where warm_start finds it. An unaccepted notebook cannot start a session.
dhrona-start prints the Ramabana bootstrap and resume commands by default. --launch runs them.
dhrona-start training/github-research.ipynb --root /path/to/project
dhrona-start training/github-research.ipynb --root /path/to/project --launch
Ramabana receives the accepted round as its first bootstrap turn and saves it. Dhrona then resumes that session. Leela can use compiled_history directly when it adds prepared-history support.
Warm start a chat
warm_start returns canonical Urai history from the accepted rounds in the library and the seeds packaged with dhrona. Pass the tools you offer (a list of callables or tool names, or a name → callable dict) and only rounds whose recorded calls bind to those signatures (call_valid) are replayed; a round for a renamed or re-parameterised tool is skipped rather than taught. Rounds sort by meta.rank (lower first), then same-model first, and limit keeps the best few. Pass it to any Urai or Rishi chat through messages=, or call prepare_chat on an empty chat.
Seven seeds ship with dhrona, each one short session on the shalya 0.1.0 / ramabana 0.2.0 tool set:
git-flow(rank 10) —git_status→git_diff→git_commit(message, paths)→git_divergence→git_remote(op='push'): git through the git tools, and the commit result’sundotoken.search-choice(rank 20) —search_codefor a concept,grep(regex=False)for literal callers,lsfor a folder: which search tool fits which question.notebook-edit(rank 30) —notebook_cells→view_cell→edit_cell(path, cell_id, edits): notebooks are edited by cell id with nativeedits.approval-refused(rank 40) —view_file→replace_text(path, edits)refused: name the refused edit, say nothing changed, ask once.memory-key(rank 50) —remember(key=)twice, thenmemory_search: a key replaces a note instead of duplicating it.delegation(rank 60) —delegate_search(questions=[...]), thenview_fileon the cited lines: a sub-agent’s report is a hypothesis until confirmed.fossick-github—run_shellwithfossick read-gh-repoas the first research call for a GitHub repository.
def run_shell(command, cwd='.', timeout=60): ...
history = warm_start([run_shell])
[(message['role'], message.get('name')) for message in history]
A completion receipt includes the package version and round revision. completion_valid rejects receipts from an older round.
Move sessions between hosts
Aidialog notebooks are the interchange format. Ramabana, Claude, and Codex sessions can all be imported for review in Leela.
dhrona-import ramabana training/round.ipynb --session latest
dhrona-import claude training/round.ipynb --session latest --cwd /path/to/project
dhrona-import codex training/round.ipynb --session latest --cwd /path/to/project
The same reviewed notebook can become a Ramabana bootstrap, a resumable Claude session, or Codex-native Responses items.
dhrona-export training/round.ipynb ramabana --output training/round.txt
dhrona-export training/round.ipynb claude --cwd /path/to/project
dhrona-export training/round.ipynb codex --output training/round-items.json
Claude Code can resume the id printed by the Claude export. Codex export does not create a resumable rollout because llmsurgery has no public rollout writer. The exported items remain suitable for inspection, datasets, and a future Codex launcher.
Command line
| Command | Purpose |
|---|---|
dhrona |
Score tool routes in Ramabana history |
dhrona-tools |
Tool use, failures and bypasses per tool and per model |
dhrona-capture |
Save a Ramabana session as a review notebook |
dhrona-accept |
Accept a reviewed round; --install adds it to the library |
dhrona-start |
Bootstrap and resume Ramabana with an accepted round |
dhrona-import |
Import a Ramabana, Claude or Codex session as a notebook |
dhrona-export |
Export a notebook for Ramabana, Claude or Codex |
Develop
uv sync --all-extras --group dev
uv run nbdev-prepare
Metadata
Release files for dhrona 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dhrona-0.1.4.tar.gz | 23.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dhrona-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.9 kB
Release files / dhrona-0.1.4.tar.gz
| Download URL | dhrona-0.1.4.tar.gz |
|---|---|
| Size | 23.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3277068aa1cb3462d14ba46693c9981fd97ea769d9b6af53eb987fde0dc9bf5
|
|
BLAKE2b-256 checksum How to use checksums |
ecf8677d8c37acddc10bf360bb5759cbddeb6e47a3d8beef4a8a0cd5879ec117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / dhrona-0.1.4-py3-none-any.whl
| Download URL | dhrona-0.1.4-py3-none-any.whl |
|---|---|
| Size | 29.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ce1437a403fc530dd681650710ec31dbb1725cb56316176ca60e6f17583024c
|
|
BLAKE2b-256 checksum How to use checksums |
a75ef57e0c8cfe36465fe539d1364e58cfc1b1b7b66250337413b532bf8d318c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|