DeonticBench
Use this sample to study an agent answering a legal-reasoning question from supplied facts and statutes. It turns the statutes into a searchable corpus, gives the agent reading and calculation tools, and records a submitted answer.
What you supply
Section titled “What you supply”Provide a Case containing the question, facts, answer format, and statutes, plus a RunConfig with the policy and enabled tools. build_world() returns the agent, workspace, and task prompt. Supply a scoring callback when collection needs an outcome reward; answers can otherwise be scored outside the rollout.
What to adapt
Section titled “What to adapt”Start with the corpus construction, answer format, and scorer when adapting this sample to another document-based reasoning task. DeonticEnv handles tool-call accounting and submission, while the context builder controls summarization. These task choices remain separate from FOCUS’s search and learning rules.
The reference below covers the case format, environment, configuration, and assembly helpers.
Represent one DeonticBench problem, its reference answer, and the legal materials needed to solve it.
Definition
Fields
DeonticEnv
Section titled “DeonticEnv”Apply statute-search and reading actions, account for the round’s tool budget, and grade a submitted answer.
Definition
DeonticEnv.init
Section titled “DeonticEnv.init”DeonticEnv.on_compaction_failure
Section titled “DeonticEnv.on_compaction_failure”DeonticEnv.initial_state
Section titled “DeonticEnv.initial_state”DeonticEnv.reward
Section titled “DeonticEnv.reward”DeonticEnv.on_tool_calls
Section titled “DeonticEnv.on_tool_calls”DeonticState
Section titled “DeonticState”Track which legal materials the agent has inspected and the remaining tool-call allowance.
Definition
Fields
RunConfig
Section titled “RunConfig”Configure the model, tool budgets, context management, and execution choices for a DeonticBench run.
Definition
Fields
Bundle a prepared legal-reasoning case with its agent, workspace, and prompt.
Definition
Fields
build_corpus
Section titled “build_corpus”Build the searchable corpus from a case’s files and cited statutes.
Definition
build_world
Section titled “build_world”Assemble the corpus, tools, environment, context manager, agent, workspace, and prompt for one legal-reasoning case.
Definition