verifiers 0.3.2.dev51__py3-none-any.whl → 0.3.2.dev53__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.
- verifiers/v1/acp/__init__.py +5 -6
- verifiers/v1/harnesses/rlm/harness.py +5 -1
- verifiers/v1/semantic.py +2 -2
- verifiers/v1/serve/client.py +6 -2
- verifiers/v1/trace.py +22 -6
- {verifiers-0.3.2.dev51.dist-info → verifiers-0.3.2.dev53.dist-info}/METADATA +1 -1
- {verifiers-0.3.2.dev51.dist-info → verifiers-0.3.2.dev53.dist-info}/RECORD +10 -10
- {verifiers-0.3.2.dev51.dist-info → verifiers-0.3.2.dev53.dist-info}/WHEEL +0 -0
- {verifiers-0.3.2.dev51.dist-info → verifiers-0.3.2.dev53.dist-info}/entry_points.txt +0 -0
- {verifiers-0.3.2.dev51.dist-info → verifiers-0.3.2.dev53.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/acp/__init__.py
CHANGED
|
@@ -78,12 +78,11 @@ class ACPHarness(Harness[ConfigT]):
|
|
|
78
78
|
self, trace: Trace, response_metadata: dict[str, Any]
|
|
79
79
|
) -> None:
|
|
80
80
|
"""Attach optional protocol extensions understood by every ACP harness."""
|
|
81
|
-
if ACP_SEMANTIC_EDGES_METADATA_KEY
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
trace.add_semantic_edges(edge_set)
|
|
81
|
+
if ACP_SEMANTIC_EDGES_METADATA_KEY in response_metadata:
|
|
82
|
+
edge_set = SemanticEdgeSet.model_validate(
|
|
83
|
+
response_metadata[ACP_SEMANTIC_EDGES_METADATA_KEY]
|
|
84
|
+
)
|
|
85
|
+
trace.add_semantic_edges(edge_set)
|
|
87
86
|
|
|
88
87
|
@abstractmethod
|
|
89
88
|
async def prepare_acp(
|
|
@@ -51,10 +51,13 @@ class CompactionConfig(BaseConfig):
|
|
|
51
51
|
max_compactions: PositiveInt | None = None
|
|
52
52
|
"""Compactions per session before the engine stops compacting; `None` =
|
|
53
53
|
nano-rlm's default."""
|
|
54
|
+
max_attempts: PositiveInt | None = None
|
|
55
|
+
"""Summary-generation attempts within one compaction cycle; `None` =
|
|
56
|
+
nano-rlm's default (5)."""
|
|
54
57
|
|
|
55
58
|
|
|
56
59
|
class RLMHarnessConfig(HarnessConfig):
|
|
57
|
-
version: str = Field(default="
|
|
60
|
+
version: str = Field(default="e384006", min_length=1)
|
|
58
61
|
"""Git ref (branch, tag, or commit) of nano-rlm to install. Must know every
|
|
59
62
|
field this harness puts on the wire, i.e. be at least the default ref."""
|
|
60
63
|
max_depth: NonNegativeInt | None = None
|
|
@@ -170,6 +173,7 @@ class RLMHarness(ACPHarness[RLMHarnessConfig]):
|
|
|
170
173
|
policy_knobs["compaction"] = True
|
|
171
174
|
policy_knobs["summarize_at_tokens"] = compaction.summarize_at_tokens
|
|
172
175
|
policy_knobs["max_compactions"] = compaction.max_compactions
|
|
176
|
+
policy_knobs["max_compaction_attempts"] = compaction.max_attempts
|
|
173
177
|
appends = [
|
|
174
178
|
text
|
|
175
179
|
for text in (system_prompt, self.config.append_to_system_prompt)
|
verifiers/v1/semantic.py
CHANGED
|
@@ -63,8 +63,8 @@ class SemanticEdgeSet(BaseModel):
|
|
|
63
63
|
"""A harness-published set of semantic edges over logical request IDs.
|
|
64
64
|
|
|
65
65
|
Edge labels are intentionally extensible. Initial harnesses use ``continuation``,
|
|
66
|
-
``compaction``, ``subagent_call``, and ``subagent_return``;
|
|
67
|
-
unknown labels.
|
|
66
|
+
``compaction_attempt``, ``compaction``, ``subagent_call``, and ``subagent_return``;
|
|
67
|
+
consumers must preserve unknown labels.
|
|
68
68
|
"""
|
|
69
69
|
|
|
70
70
|
model_config = ConfigDict(extra="forbid", strict=True)
|
verifiers/v1/serve/client.py
CHANGED
|
@@ -187,8 +187,12 @@ class EnvClient:
|
|
|
187
187
|
self._receiver = None
|
|
188
188
|
# Let scheduled fire-and-forget cancels reach the socket first, or a
|
|
189
189
|
# run cancelled right before close() leaves its server-side rollout
|
|
190
|
-
# running.
|
|
190
|
+
# running. Pop before awaiting: awaiting finished tasks never yields
|
|
191
|
+
# (since CPython 3.12 a gather of them completes eagerly), so their
|
|
192
|
+
# queued `discard` callbacks cannot be what empties the set
|
|
191
193
|
while self._cancel_tasks:
|
|
192
|
-
|
|
194
|
+
task = self._cancel_tasks.pop()
|
|
195
|
+
with contextlib.suppress(asyncio.CancelledError):
|
|
196
|
+
await task
|
|
193
197
|
self.socket.close()
|
|
194
198
|
self.ctx.term()
|
verifiers/v1/trace.py
CHANGED
|
@@ -20,11 +20,7 @@ from verifiers.v1.configs.agent import AgentConfig, WireAgentConfig
|
|
|
20
20
|
from verifiers.v1.errors import ProviderError
|
|
21
21
|
from verifiers.v1.graph import RECORD_FLOAT_DECIMALS, MessageNode
|
|
22
22
|
from verifiers.v1.runtimes import RuntimeInfo
|
|
23
|
-
from verifiers.v1.semantic import
|
|
24
|
-
ACPInfo,
|
|
25
|
-
ParentLink,
|
|
26
|
-
SemanticEdgeSet,
|
|
27
|
-
)
|
|
23
|
+
from verifiers.v1.semantic import ACPInfo, ParentLink, SemanticEdgeSet
|
|
28
24
|
from verifiers.v1.state import State, StateT
|
|
29
25
|
from verifiers.v1.task import DataT, WireTaskData
|
|
30
26
|
from verifiers.v1.types import (
|
|
@@ -201,6 +197,8 @@ class Branch(BaseModel):
|
|
|
201
197
|
index: int
|
|
202
198
|
nodes: list[MessageNode]
|
|
203
199
|
calls: list[ModelCall] = Field(default_factory=list)
|
|
200
|
+
trainable: bool = True
|
|
201
|
+
"""Whether this physical path contributes a training sample."""
|
|
204
202
|
mm_token_type_id_map: dict[int, int] = Field(default_factory=dict)
|
|
205
203
|
"""The trace's `mm_token_type_id_map`, carried so `mm_token_type_ids` is self-contained."""
|
|
206
204
|
|
|
@@ -492,8 +490,18 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
492
490
|
|
|
493
491
|
@property
|
|
494
492
|
def branches(self) -> list[Branch]:
|
|
495
|
-
"""One root-to-leaf
|
|
493
|
+
"""One root-to-leaf view per graph leaf, with no duplicated node storage.
|
|
494
|
+
|
|
495
|
+
A compaction attempt is a dangling physical leaf. It is trainable only when
|
|
496
|
+
the final semantic graph shows that the harness resumed from it.
|
|
497
|
+
"""
|
|
496
498
|
by_node = {c.node: c for c in self.calls if c.node is not None}
|
|
499
|
+
accepted_compaction_attempts = {
|
|
500
|
+
link.node
|
|
501
|
+
for node in self.nodes
|
|
502
|
+
for link in node.semantic_parents
|
|
503
|
+
if link.type == "compaction"
|
|
504
|
+
}
|
|
497
505
|
branches: list[Branch] = []
|
|
498
506
|
for i, leaf in enumerate(graph.leaves(self)):
|
|
499
507
|
path: list[int] = []
|
|
@@ -502,11 +510,19 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
502
510
|
path.append(nid)
|
|
503
511
|
nid = self.nodes[nid].parent
|
|
504
512
|
path.reverse()
|
|
513
|
+
is_compaction_attempt = any(
|
|
514
|
+
link.type == "compaction_attempt"
|
|
515
|
+
for link in self.nodes[leaf].semantic_parents
|
|
516
|
+
)
|
|
505
517
|
branches.append(
|
|
506
518
|
Branch(
|
|
507
519
|
index=i,
|
|
508
520
|
nodes=[self.nodes[n] for n in path],
|
|
509
521
|
calls=[by_node[n] for n in path if n in by_node],
|
|
522
|
+
trainable=(
|
|
523
|
+
not is_compaction_attempt
|
|
524
|
+
or leaf in accepted_compaction_attempts
|
|
525
|
+
),
|
|
510
526
|
mm_token_type_id_map=self.mm_token_type_id_map,
|
|
511
527
|
)
|
|
512
528
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.dev53
|
|
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
|
|
@@ -9,14 +9,14 @@ verifiers/v1/graph.py,sha256=K6wKkoT_8TpNqPQISu2Xf0eHtAYW_KUGw0CteN5zr3c,36529
|
|
|
9
9
|
verifiers/v1/harness.py,sha256=Yx-XCIs1HAmqv1F-nhCTDBUwAx51xQWNWgFcWL1WRTM,13777
|
|
10
10
|
verifiers/v1/judge.py,sha256=uqn-djkK2_7Q3kOjkDo6ipOvV_HOvuLa9y6AoDjRux8,9618
|
|
11
11
|
verifiers/v1/rollout.py,sha256=FT6ZYfSqkKOFa5tm52XDTLijKxqpeLr3x2MBdLIk4xk,24021
|
|
12
|
-
verifiers/v1/semantic.py,sha256=
|
|
12
|
+
verifiers/v1/semantic.py,sha256=VQ_buw6Ya6QtRoh_fiYI5Avs5RmIQCfWH0H0bQc4aoc,4704
|
|
13
13
|
verifiers/v1/session.py,sha256=xM7JJJVJACk0JfH9RAN1Ts8gJJKr2tGGRiIgQTrdieY,18692
|
|
14
14
|
verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
|
|
15
15
|
verifiers/v1/task.py,sha256=9YhllEDgoHSz72-1fcYwBADl-rOzASnrSVimLheWmwI,12237
|
|
16
16
|
verifiers/v1/taskset.py,sha256=fp2E0IEhL_Ybj9cegZwljfTmW27p_30zTWHFKw_kXE4,4374
|
|
17
|
-
verifiers/v1/trace.py,sha256=
|
|
17
|
+
verifiers/v1/trace.py,sha256=dBrStZXoEhVIKtcUzG6lZN0SEAjATOqBZCrgbaPdIXw,30398
|
|
18
18
|
verifiers/v1/types.py,sha256=PH1SxRWXOjPCgQD9aZgM18_bECvFSNQ25gkCbulmTKU,9857
|
|
19
|
-
verifiers/v1/acp/__init__.py,sha256=
|
|
19
|
+
verifiers/v1/acp/__init__.py,sha256=sbJL7vTE_BEmw34wwgbNPuWuAmQ_gwELsK3wQbT08f4,12715
|
|
20
20
|
verifiers/v1/acp/runner.py,sha256=gMXFmsVg2qD0Zhrx7kvC6Me2Z-wsfBamRIO0i45UW8g,11097
|
|
21
21
|
verifiers/v1/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
verifiers/v1/cli/debug.py,sha256=x3bqOwwbwwfwQQpxHrZeKdxsW3ZVtUT9cAn_r4aOro4,11631
|
|
@@ -112,7 +112,7 @@ verifiers/v1/harnesses/pool/harness.py,sha256=TsELYhW4mMOt_laiDN6nAQJxFL3iCcKvck
|
|
|
112
112
|
verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
|
|
113
113
|
verifiers/v1/harnesses/prime_agent/harness.py,sha256=CgrKBXoelwRiSH9fzsNnz4oykz_iDJ3p5WVGBOB9AeU,10906
|
|
114
114
|
verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
|
|
115
|
-
verifiers/v1/harnesses/rlm/harness.py,sha256=
|
|
115
|
+
verifiers/v1/harnesses/rlm/harness.py,sha256=A-3lUD4t6kND5Hq01wedTbAcCWAlQvjqn-QQKBIYbi4,10671
|
|
116
116
|
verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
|
|
117
117
|
verifiers/v1/harnesses/terminus_2/harness.py,sha256=DMTY1bzvydyjHqzmvBSBGKJsmUzYEgxqd215a7cG7tg,3052
|
|
118
118
|
verifiers/v1/harnesses/terminus_2/program.py,sha256=X8MZdyItU3gbXGXnGOlJ9LWcUTnqIDaxlhkZvoRiqKY,2703
|
|
@@ -149,7 +149,7 @@ verifiers/v1/runtimes/subprocess.py,sha256=IO82fI1wFbeTtV7T1AHSF8iTUyT9yGJFIUmCK
|
|
|
149
149
|
verifiers/v1/runtimes/docker/__init__.py,sha256=K6xbJAT1F3-PtgP5Gum2UJKQ8Re1Yz90BP8Uc7Npec4,20594
|
|
150
150
|
verifiers/v1/runtimes/docker/egress.py,sha256=iFH_1XotlEM-OCaW7GNu3TWVEq1sqesKYweyVBX8g90,14360
|
|
151
151
|
verifiers/v1/serve/__init__.py,sha256=doImCSxSYZEjVDXfRafLHkhHXcXQxzA6qUGMBQ8bSko,477
|
|
152
|
-
verifiers/v1/serve/client.py,sha256=
|
|
152
|
+
verifiers/v1/serve/client.py,sha256=biy46qOOFTjMXSIsY8W1vMEfctn7usCeNuBQsJqc2mc,7789
|
|
153
153
|
verifiers/v1/serve/encoding.py,sha256=5tKagKZKwBPN6VydLObCKDzLnijrvRwMjuyVQUq5BKA,2399
|
|
154
154
|
verifiers/v1/serve/pool.py,sha256=HZsJPcru9eNrxo3Rmi-Vdt1tjZwqo2oI4Ql_IKfUMtY,15443
|
|
155
155
|
verifiers/v1/serve/server.py,sha256=h1B53RZBuYgRt4xmh9L6jBJ0KvCdq7wmCAa3nwkJMok,8778
|
|
@@ -189,8 +189,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
|
|
|
189
189
|
verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
|
|
190
190
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
191
191
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
192
|
-
verifiers-0.3.2.
|
|
193
|
-
verifiers-0.3.2.
|
|
194
|
-
verifiers-0.3.2.
|
|
195
|
-
verifiers-0.3.2.
|
|
196
|
-
verifiers-0.3.2.
|
|
192
|
+
verifiers-0.3.2.dev53.dist-info/METADATA,sha256=WsxrCV0NFu4InfbroNkjxpmMRQpQxV8jGbBN1f23GEM,4153
|
|
193
|
+
verifiers-0.3.2.dev53.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
194
|
+
verifiers-0.3.2.dev53.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
|
|
195
|
+
verifiers-0.3.2.dev53.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
196
|
+
verifiers-0.3.2.dev53.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|