verifiers 0.3.2.dev36__py3-none-any.whl → 0.3.2.dev37__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,14 @@ import logging
5
5
  import shlex
6
6
  from typing import Any, Literal
7
7
 
8
- from pydantic import BaseModel, ConfigDict, Field, PositiveInt, model_validator
8
+ from pydantic import (
9
+ BaseModel,
10
+ ConfigDict,
11
+ Field,
12
+ NonNegativeInt,
13
+ PositiveInt,
14
+ model_validator,
15
+ )
9
16
  from pydantic_config import BaseConfig
10
17
 
11
18
  from verifiers.v1.acp import ACPConfig, ACPHarness, ACPTurn, JsonObject
@@ -17,7 +24,7 @@ from verifiers.v1.trace import Trace
17
24
 
18
25
  logger = logging.getLogger(__name__)
19
26
 
20
- BuiltinSkill = Literal["edit", "search"]
27
+ BuiltinSkill = Literal["bash", "edit", "fetch", "search"]
21
28
 
22
29
  RLM_REPO = "github.com/PrimeIntellect-ai/nano-rlm.git"
23
30
  RLM_CACHE_DIR = "/tmp/vf-rlm"
@@ -43,15 +50,36 @@ class CompactionConfig(BaseConfig):
43
50
 
44
51
 
45
52
  class RLMHarnessConfig(HarnessConfig):
46
- version: str = Field(default="4ef3438", min_length=1)
47
- """Git ref (branch, tag, or commit) of nano-rlm to install."""
48
- max_depth: int = 0
49
- """Recursion depth RLM may spawn sub-harnesses to."""
53
+ version: str = Field(default="240090d", min_length=1)
54
+ """Git ref (branch, tag, or commit) of nano-rlm to install. Must know every
55
+ field this harness puts on the wire, i.e. be at least the default ref."""
56
+ max_depth: NonNegativeInt | None = None
57
+ """Recursion depth RLM may spawn sub-agents to; `None` = nano-rlm's default (1).
58
+ Set 0 to disable recursion."""
50
59
  builtin_skills: list[BuiltinSkill] = Field(default_factory=list)
51
60
  """Built-in rlm skills to enable (RLM_SKILLS), e.g. `["edit"]`; empty enables none.
52
61
  The tool set is fixed (ipython); the base `skills` field takes SKILL.md paths."""
53
62
  compaction: CompactionConfig | None = None
54
63
  """Context compaction policy. Set an empty config to use automatic thresholds."""
64
+ max_concurrent_subagents: PositiveInt | None = None
65
+ """Sub-agents running at once per session tree; `None` = nano-rlm's default (4).
66
+ nano-rlm requires it to be at least `max_depth`."""
67
+ max_total_turns: PositiveInt | None = None
68
+ """Tree-total turn budget (one turn = one work-loop model call, any engine); every
69
+ engine stops before its next call once spent. `None` = uncapped."""
70
+ max_total_tokens: PositiveInt | None = None
71
+ """Tree-total budget of NEW tokens (completion + uncached prompt) across the session
72
+ tree; once spent every engine stops and no further sub-agents spawn. `None` = unbounded."""
73
+ max_tool_output_bytes: PositiveInt | None = None
74
+ """Byte budget for a single tool result entering the conversation (middle truncation);
75
+ overrides rlm's built-in 20KB default in either direction."""
76
+ append_to_system_prompt: str | None = None
77
+ """Appended to the root engine's system prompt, after the taskset's system prompt."""
78
+ subagent_append_to_system_prompt: str | None = None
79
+ """Append for sub-agent engines that can still delegate (depth >= 1, below
80
+ `max_depth`); unset falls back to `append_to_system_prompt`."""
81
+ leaf_append_to_system_prompt: str | None = None
82
+ """Append for depth-capped leaf engines; unset falls back to the sub-agent append."""
55
83
 
56
84
  @model_validator(mode="after")
57
85
  def reject_disabled_tools(self) -> "RLMHarnessConfig":
@@ -60,6 +88,15 @@ class RLMHarnessConfig(HarnessConfig):
60
88
  "the rlm harness has a fixed tool set (ipython) and does not support "
61
89
  "`disabled_tools`; use `builtin_skills` to enable built-in skills instead."
62
90
  )
91
+ if (
92
+ self.max_depth is not None
93
+ and self.max_concurrent_subagents is not None
94
+ and self.max_concurrent_subagents < self.max_depth
95
+ ):
96
+ raise ValueError(
97
+ "`max_concurrent_subagents` must be at least `max_depth` "
98
+ "(nano-rlm rejects the policy otherwise)."
99
+ )
63
100
  return self
64
101
 
65
102
 
@@ -109,6 +146,11 @@ class RLMHarness(ACPHarness[RLMHarnessConfig]):
109
146
  system_prompt: str | None,
110
147
  ) -> JsonObject:
111
148
  compaction = self.config.compaction
149
+ appends = [
150
+ text
151
+ for text in (system_prompt, self.config.append_to_system_prompt)
152
+ if text
153
+ ]
112
154
  payload = {
113
155
  "session_id": trace.id,
114
156
  "model": ctx.model,
@@ -116,16 +158,29 @@ class RLMHarness(ACPHarness[RLMHarnessConfig]):
116
158
  "base_url": endpoint,
117
159
  "api_key": secret,
118
160
  },
161
+ # None = passthrough: the key stays off the wire and nano-rlm's own
162
+ # default applies.
119
163
  "policy": {
120
- "max_depth": self.config.max_depth,
121
- "compaction": compaction is not None,
122
- "summarize_at_tokens": (
123
- compaction.summarize_at_tokens if compaction else None
124
- ),
125
- "max_concurrent_subagents": max(4, self.config.max_depth),
164
+ key: value
165
+ for key, value in {
166
+ "max_depth": self.config.max_depth,
167
+ "compaction": compaction is not None,
168
+ "summarize_at_tokens": (
169
+ compaction.summarize_at_tokens if compaction else None
170
+ ),
171
+ "max_concurrent_subagents": self.config.max_concurrent_subagents,
172
+ "max_total_turns": self.config.max_total_turns,
173
+ "max_total_tokens": self.config.max_total_tokens,
174
+ "max_tool_output_bytes": self.config.max_tool_output_bytes,
175
+ }.items()
176
+ if value is not None
126
177
  },
127
178
  "system_prompt_path": None,
128
- "append_to_system_prompt": system_prompt,
179
+ "append_to_system_prompt": "\n\n".join(appends) or None,
180
+ "subagent_append_to_system_prompt": (
181
+ self.config.subagent_append_to_system_prompt
182
+ ),
183
+ "leaf_append_to_system_prompt": self.config.leaf_append_to_system_prompt,
129
184
  "skills": list(self.config.builtin_skills),
130
185
  "kernel_env": runtime.env,
131
186
  "search_api_key": self.config.resolved_env.get("SERPER_API_KEY"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev36
3
+ Version: 0.3.2.dev37
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -109,7 +109,7 @@ verifiers/v1/harnesses/pool/harness.py,sha256=HKAogPbyLK5QpvPQ1teHOh_IyRQX-or2JF
109
109
  verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
110
110
  verifiers/v1/harnesses/prime_agent/harness.py,sha256=byplbbIOFACCn2BvVZAxBSHdaPKBGERYz_hA1rgBj0E,11205
111
111
  verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
112
- verifiers/v1/harnesses/rlm/harness.py,sha256=clbx7-HQtEyEiOYu3JPEH6LaH66VYgvG3k3qLn1Re_w,7062
112
+ verifiers/v1/harnesses/rlm/harness.py,sha256=uHP8VL2CCviZr65PF0IEfgpXxj0uph0E2t6YRvmF1zM,9845
113
113
  verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
114
114
  verifiers/v1/harnesses/terminus_2/harness.py,sha256=kXKhi-aqqsoXGnvet0Tq_v7LYYpRYEzARyQL2MTEGWs,3101
115
115
  verifiers/v1/harnesses/terminus_2/program.py,sha256=X8MZdyItU3gbXGXnGOlJ9LWcUTnqIDaxlhkZvoRiqKY,2703
@@ -185,8 +185,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
185
185
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
186
186
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
187
187
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
188
- verifiers-0.3.2.dev36.dist-info/METADATA,sha256=CPiuEseqw899eF8UoezmBH1wUJVCm4_DB26wx4jIXnA,4065
189
- verifiers-0.3.2.dev36.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
190
- verifiers-0.3.2.dev36.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
191
- verifiers-0.3.2.dev36.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
192
- verifiers-0.3.2.dev36.dist-info/RECORD,,
188
+ verifiers-0.3.2.dev37.dist-info/METADATA,sha256=Kba9nRG0TlzRVxS9P51ScU0eYJJ8I4bRKDGEgMZuxY4,4065
189
+ verifiers-0.3.2.dev37.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
190
+ verifiers-0.3.2.dev37.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
191
+ verifiers-0.3.2.dev37.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
192
+ verifiers-0.3.2.dev37.dist-info/RECORD,,