Shared tools
This toolkit supplies building blocks for the sample environments rather than a benchmark task of its own. It represents documents as source files and sections, exposes list, grep, and read operations, and provides a Python calculation tool.
What you supply
Section titled “What you supply”Build a Corpus from your task’s documents and choose the tools to expose through your environment. Configure result lengths, permitted calculation imports, and execution limits to suit the task. The toolkit does not define a question, reward, or completion rule; those belong to your environment.
What to adapt
Section titled “What to adapt”Reuse the corpus tools when your agent works with read-only evidence. Replace document parsing or tool output formatting when your sources need a different structure. PythonTool runs calculations in a restricted subprocess with resource limits; it is not a container or a security boundary for arbitrary untrusted code.
The reference below covers the document model and individual tools.
Corpus
Section titled “Corpus”Expose a read-only collection of source files and addressable sections to task tools.
Definition
Fields
Corpus.paths
Section titled “Corpus.paths”Corpus.resolve
Section titled “Corpus.resolve”A file from what the model typed: an exact path, else a unique suffix.
The suffix has to start at a path-component boundary — a whole tail of the
path, never a tail of one name. Bare endswith made "ax.txt" resolve
"a/tax.txt" uniquely and confidently, which is worse than not resolving:
the model gets a file it did not ask for and cites it.
No basename tier: basename equality implies a boundary-aligned suffix, so it could only ever fire where the suffix pass already found nothing.
Corpus.manifest
Section titled “Corpus.manifest”The file list that goes in the prompt — the discovery affordance.
label is the word this task calls its sections by (“provisions” for a
statute, “headings” for a manual): the manifest is prompt text a model reads, so
it should use the task’s own vocabulary rather than this module’s.
DEFAULT_IMPORTS
Section titled “DEFAULT_IMPORTS”List the imports allowed by the Python calculation tool’s default code policy.
Definition
GrepTool
Section titled “GrepTool”Search the task corpus with a regular expression and report matching paths, lines, and sections.
Definition
GrepTool.init
Section titled “GrepTool.init”GrepTool.call
Section titled “GrepTool.call”ListTool
Section titled “ListTool”List the files available in the task corpus.
Definition
ListTool.init
Section titled “ListTool.init”ListTool.call
Section titled “ListTool.call”PythonTool
Section titled “PythonTool”Run a calculation in a subprocess with configured execution limits and an import policy.
Definition
PythonTool.init
Section titled “PythonTool.init”PythonTool.call
Section titled “PythonTool.call”ReadTool
Section titled “ReadTool”Read a file or named section from the task corpus with line numbers for citation.
Definition
ReadTool.init
Section titled “ReadTool.init”ReadTool.call
Section titled “ReadTool.call”Section
Section titled “Section”Identify a labeled range of lines within a source file.
Definition
Fields
Sectioner
Section titled “Sectioner”Define a callable that splits source text into addressable sections for corpus tools.
Definition
SourceFile
Section titled “SourceFile”Hold a mounted file’s content and the sections available for inspection.
Definition
Fields
SourceFile.sectioned
Section titled “SourceFile.sectioned”Build a file, running sectioner over its text for the section index.
SourceFile.lines
Section titled “SourceFile.lines”SourceFile.section_at
Section titled “SourceFile.section_at”The most specific section containing a 1-based line.
Spans nest, so a line inside (c)(1) is also inside (c). The narrowest
one is the citation worth printing: “§63(c)” points at sixty lines, while
“§63(c)(1)” points at the rule.
SourceFile.find
Section titled “SourceFile.find”focus.environments.toolkit.grep.DEFAULT_DESCRIPTION
Section titled “focus.environments.toolkit.grep.DEFAULT_DESCRIPTION”Supply the default model-facing description of the corpus search tool.
Definition
focus.environments.toolkit.read.DEFAULT_DESCRIPTION
Section titled “focus.environments.toolkit.read.DEFAULT_DESCRIPTION”Supply the default model-facing description of the corpus reading tool.
Definition
DEFAULT_SECTION_HELP
Section titled “DEFAULT_SECTION_HELP”Supply the default explanation of how to select a named file section.
Definition
screen_code
Section titled “screen_code”Parse Python code and reject operations disallowed by the calculation tool’s code policy.
Definition