verifiers 0.3.2.dev153__py3-none-any.whl → 0.3.2.dev155__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.
@@ -19,7 +19,9 @@ def parse_network_rule(rule: str) -> tuple[SplitResult, str, int | None]:
19
19
  return parsed, (parsed.hostname or "").lower().rstrip("."), port
20
20
 
21
21
 
22
- def network_rule_matches(rule: str, scheme: str, host: str, port: int) -> bool:
22
+ def network_rule_matches(
23
+ rule: str, scheme: str, host: str, port: int, *, subdomains: bool = False
24
+ ) -> bool:
23
25
  """Match a network-policy host pattern or URL origin. Paths are ignored."""
24
26
  try:
25
27
  parsed, pattern, rule_port = parse_network_rule(rule)
@@ -30,9 +32,7 @@ def network_rule_matches(rule: str, scheme: str, host: str, port: int) -> bool:
30
32
  if rule_port is not None and rule_port != port:
31
33
  return False
32
34
  host = host.lower().rstrip(".")
33
- return fnmatchcase(host, pattern) or (
34
- pattern.startswith("*.") and host == pattern[2:]
35
- )
35
+ return fnmatchcase(host, pattern) or (subdomains and host.endswith(f".{pattern}"))
36
36
 
37
37
 
38
38
  def intersect_network_hosts(left: str, right: str) -> str:
@@ -45,7 +45,7 @@ def intersect_network_hosts(left: str, right: str) -> str:
45
45
  parent.startswith("*.") and not has_magic(parent[2:])
46
46
  ):
47
47
  continue
48
- if fnmatchcase(child, parent) or child == parent.removeprefix("*."):
48
+ if fnmatchcase(child, parent):
49
49
  return child
50
50
  if all(has_magic(host) for host in (left, right)) and any(
51
51
  has_magic(host.removeprefix("*.")) for host in (left, right)
@@ -61,7 +61,8 @@ class NetworkPolicyConfig(BaseConfig):
61
61
  """Destinations allowed during execution; `*` is unrestricted and `[]` is
62
62
  framework-only."""
63
63
  block: list[str] = Field(default_factory=list)
64
- """Destinations denied during execution; any `*` makes the policy framework-only."""
64
+ """Denied destinations; bare domains include subdomains, `*.` excludes the base
65
+ domain, and any `*` makes the policy framework-only."""
65
66
 
66
67
  @model_validator(mode="after")
67
68
  def validate_network_policy(self) -> Self:
@@ -82,7 +83,8 @@ class NetworkPolicyConfig(BaseConfig):
82
83
  def permits(self, scheme: str, host: str, port: int) -> bool:
83
84
  """Whether the destination is allowed by the configured egress rules."""
84
85
  return not any(
85
- network_rule_matches(rule, scheme, host, port) for rule in self.block
86
+ network_rule_matches(rule, scheme, host, port, subdomains=True)
87
+ for rule in self.block
86
88
  ) and any(network_rule_matches(rule, scheme, host, port) for rule in self.allow)
87
89
 
88
90
  def with_task_network_policy(self, allow: list[str], block: list[str]) -> Self:
@@ -69,7 +69,7 @@ class CompactionConfig(BaseConfig):
69
69
 
70
70
  class RLMHarnessConfig(HarnessConfig):
71
71
  version: str = Field(
72
- default="38c44a06fdef484a19d8d6c4e5697100971f9ecd", min_length=1
72
+ default="7b5c89b2a0055e6c1a993cdd0ba0384053835f14", min_length=1
73
73
  )
74
74
  """Git ref (branch, tag, or commit) of nano-rlm to install. Must know every
75
75
  field this harness puts on the wire, i.e. be at least the default ref."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev153
3
+ Version: 0.3.2.dev155
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
@@ -48,7 +48,7 @@ verifiers/v1/configs/env.py,sha256=k47XBYYWLOf-8P1dbek3x_s0ucNb726xxoryG69DIr4,7
48
48
  verifiers/v1/configs/harness.py,sha256=ZrR-Egzfft95oMoqQ78bAq9TqP882Q68M_47Ajw9lE8,2918
49
49
  verifiers/v1/configs/judge.py,sha256=WEwA8D4X5JSaIP3c-E2wPnvgByWeT6JRAn1d8gfiQ40,2142
50
50
  verifiers/v1/configs/retries.py,sha256=-nPlgmz7J_NZ4GOYG6oCc3thXo4La2SufBmvQGvvPGo,821
51
- verifiers/v1/configs/runtime.py,sha256=ZEGx5JEgkMOLBQhiKAg6nzqKMhUu4W9tCE3AR--X8HY,5412
51
+ verifiers/v1/configs/runtime.py,sha256=3LDAnKy-BotE6MqyT1l07Y_bAq9Wye1OU8JZ7lyUVvY,5474
52
52
  verifiers/v1/configs/select.py,sha256=_HdcepQaJ1sDCYcs7Vqx72npDwHGOgUjsLDZmcgnonU,4743
53
53
  verifiers/v1/configs/serve.py,sha256=oa_0BrAVEKboU344w0hYkSaXj8lf26t0H87gvncAo0Q,2716
54
54
  verifiers/v1/configs/task.py,sha256=57OnEGAa6jTiG12Lx_elREU02koYh8UkM0t0Vvxahys,2614
@@ -113,7 +113,7 @@ verifiers/v1/harnesses/pi/harness.py,sha256=ysKOLSRQnbPkMtwvuUoJU7Hd4uM4bDF1duD0
113
113
  verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
114
114
  verifiers/v1/harnesses/prime_agent/harness.py,sha256=Zs_f5H2hQgDzUS4zwArM5UxCYJI5Zo0ELmayn1oBkK0,10663
115
115
  verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
116
- verifiers/v1/harnesses/rlm/harness.py,sha256=Nh4nBxxYDnRgRE-BljWBEnptX2JnDKAGVXCrAnpjm2w,13538
116
+ verifiers/v1/harnesses/rlm/harness.py,sha256=zA4VB23ibYnw5WZfhvZipxxm5Ift01pG-FaYzMtY3PI,13538
117
117
  verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
118
118
  verifiers/v1/harnesses/terminus_2/harness.py,sha256=cKQJluW01mkxEccTLFwSWsVMavyiwq_w-NA4Hb_JkGU,3052
119
119
  verifiers/v1/harnesses/terminus_2/program.py,sha256=X8MZdyItU3gbXGXnGOlJ9LWcUTnqIDaxlhkZvoRiqKY,2703
@@ -193,8 +193,8 @@ verifiers/v1/utils/scope.py,sha256=bzUEiWDOVdbj7dXOwGOlzsQ_-Xu0j9NR5TalQB-8TS8,8
193
193
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
194
194
  verifiers/v1/utils/trace_store.py,sha256=RsCDonGR-bs-tvEstcppiJm3jFmAdIiG83fA5KtCbAw,2801
195
195
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
196
- verifiers-0.3.2.dev153.dist-info/METADATA,sha256=vSm4TEvKtJXIhjsj8XEopHBKEMcpHh3sm0__6MRxgn8,4161
197
- verifiers-0.3.2.dev153.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
- verifiers-0.3.2.dev153.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
- verifiers-0.3.2.dev153.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
- verifiers-0.3.2.dev153.dist-info/RECORD,,
196
+ verifiers-0.3.2.dev155.dist-info/METADATA,sha256=_8FL9NqqyE2TxMxg99xcayYl67d8IEYE_vwHoYGI6kY,4161
197
+ verifiers-0.3.2.dev155.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
198
+ verifiers-0.3.2.dev155.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
199
+ verifiers-0.3.2.dev155.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.3.2.dev155.dist-info/RECORD,,