calibrated_agent_evaluation.review.renderers¶
calibrated_agent_evaluation.review.renderers ¶
Plugin-renderer seam for the review surface.
RendererRegistry (in base) is the FastHTML-free resolver; tool_call_tree_renderer
(in default) is the built-in fallback view. make_default_registry wires them together:
the app builds one, and a domain registers its own renderers on it via register(predicate, fn).
The concrete renderers need fasthtml (the [ui] extra), so they load on first use. Importing
this package for RendererRegistry alone, as calibrated_agent_evaluation.review does, needs
no extra.
RendererRegistry
dataclass
¶
Resolve a trace's renderer: the first registered predicate that matches, else the default.
Construct with the default renderer (the app wires the tool-call-tree renderer). Register
domain renderers with register. render is the safe entry point; it guards a
raising renderer back to the default and logs, so one bad plugin never ends the session.
register ¶
Register renderer for any trace where predicate(trace) is true.
Registration order is match order; the first matching predicate wins.
Source code in src/calibrated_agent_evaluation/review/renderers/base.py
resolve ¶
Return the first renderer whose predicate matches trace, else the default.
Note: a predicate that itself raises is treated as non-matching (guarded + logged) so a broken predicate cannot mask the default.
Source code in src/calibrated_agent_evaluation/review/renderers/base.py
render ¶
Render trace with the resolved renderer; fall back to the default on error.
A registered renderer that raises is caught and logged (logging.exception) and the
default renderer is used instead; the labeling session continues rather than crashing.
Use render_with_status to also learn that a fallback happened.
Source code in src/calibrated_agent_evaluation/review/renderers/base.py
render_with_status ¶
Like render, plus a message naming the failure when the default stood in.
The message is for the labeler's screen. A fallback that only reached the log looked, to the person labeling, exactly like a trace the plugin was never meant to render.
Source code in src/calibrated_agent_evaluation/review/renderers/base.py
tool_call_tree_renderer ¶
Render trace as its terminal I/O plus (for owned traces) the tool-call span tree.
Source code in src/calibrated_agent_evaluation/review/renderers/default.py
make_default_registry ¶
A fresh registry whose default is the built-in tool-call-tree renderer.