blockmachine 0.8.1__tar.gz → 0.8.2__tar.gz
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.
- {blockmachine-0.8.1 → blockmachine-0.8.2}/PKG-INFO +1 -1
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/PKG-INFO +1 -1
- {blockmachine-0.8.1 → blockmachine-0.8.2}/commands/leaderboard.py +19 -11
- {blockmachine-0.8.1 → blockmachine-0.8.2}/pyproject.toml +1 -1
- {blockmachine-0.8.1 → blockmachine-0.8.2}/tests/test_leaderboard_cli.py +29 -12
- {blockmachine-0.8.1 → blockmachine-0.8.2}/__init__.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/auth_config.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/SOURCES.txt +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/dependency_links.txt +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/entry_points.txt +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/requires.txt +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/blockmachine.egg-info/top_level.txt +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/client.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/commands/__init__.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/commands/auth.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/commands/miner.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/commands/validator.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/config.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/endpoints.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/main.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/settings.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/setup.cfg +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/testing.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/tests/test_cli_config.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/tests/test_cli_endpoints_and_testing.py +0 -0
- {blockmachine-0.8.1 → blockmachine-0.8.2}/utils.py +0 -0
|
@@ -90,8 +90,12 @@ def _node_score_field(node: dict, field: str, archive: bool) -> Optional[float]:
|
|
|
90
90
|
return node.get(field)
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
def
|
|
94
|
-
"""True if the node
|
|
93
|
+
def _is_in_probation(node: dict, archive: bool) -> bool:
|
|
94
|
+
"""True if the node is explicitly reported as probation."""
|
|
95
|
+
scoring_state = node.get("scoring_state")
|
|
96
|
+
if scoring_state is not None:
|
|
97
|
+
return scoring_state == "probation"
|
|
98
|
+
|
|
95
99
|
score = _node_score_field(node, "routing_score", archive)
|
|
96
100
|
return score == 0.0
|
|
97
101
|
|
|
@@ -160,9 +164,9 @@ def _render_default(data: dict, own_hotkey: Optional[str], archive: bool) -> Non
|
|
|
160
164
|
node_score = _node_score_field(node, "routing_score", archive)
|
|
161
165
|
node_pf = _node_score_field(node, "price_factor", archive)
|
|
162
166
|
node_traffic = node.get("_share") or 0.0
|
|
163
|
-
|
|
167
|
+
in_probation = _is_in_probation(node, archive)
|
|
164
168
|
node_name = prefix + _node_display_name(node)
|
|
165
|
-
if
|
|
169
|
+
if in_probation:
|
|
166
170
|
node_name += " \u21ba"
|
|
167
171
|
|
|
168
172
|
table.add_row(
|
|
@@ -185,12 +189,14 @@ def _render_default(data: dict, own_hotkey: Optional[str], archive: bool) -> Non
|
|
|
185
189
|
footer_parts.append("[yellow]*[/yellow] = your miner")
|
|
186
190
|
footer_parts.append(f"{len(miners)} miners")
|
|
187
191
|
footer_parts.append(f"{total_cus:,} total CUs")
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
has_probation = any(
|
|
193
|
+
_is_in_probation(n, archive)
|
|
194
|
+
for m in miners_with_scores
|
|
195
|
+
for n in m.get("nodes", [])
|
|
190
196
|
)
|
|
191
|
-
if
|
|
197
|
+
if has_probation:
|
|
192
198
|
footer_parts.append(
|
|
193
|
-
"[dim]\u21ba = in
|
|
199
|
+
"[dim]\u21ba = in probation (building score via synthetic probes)[/dim]"
|
|
194
200
|
)
|
|
195
201
|
console.print(" " + " \u00b7 ".join(footer_parts))
|
|
196
202
|
|
|
@@ -288,10 +294,12 @@ def _render_detail(data: dict, own_hotkey: Optional[str], archive: bool) -> None
|
|
|
288
294
|
)
|
|
289
295
|
|
|
290
296
|
for node in miner.get("nodes", []):
|
|
291
|
-
|
|
292
|
-
" [dim]\u21ba
|
|
297
|
+
probation_tag = (
|
|
298
|
+
" [dim]\u21ba probation[/dim]"
|
|
299
|
+
if _is_in_probation(node, archive)
|
|
300
|
+
else ""
|
|
293
301
|
)
|
|
294
|
-
console.print(f" [dim]{_node_display_name(node)}[/dim]{
|
|
302
|
+
console.print(f" [dim]{_node_display_name(node)}[/dim]{probation_tag}")
|
|
295
303
|
|
|
296
304
|
lat = node.get("latency_score") or 0.0
|
|
297
305
|
rel = node.get("reliability") or 0.0
|
|
@@ -179,22 +179,38 @@ class TestArchiveOrdering:
|
|
|
179
179
|
assert archive[0]["hotkey"] == "hk-archive"
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
class
|
|
183
|
-
def
|
|
184
|
-
from cli.commands.leaderboard import
|
|
182
|
+
class TestProbationDisplay:
|
|
183
|
+
def test_is_in_probation_prefers_explicit_scoring_state(self):
|
|
184
|
+
from cli.commands.leaderboard import _is_in_probation
|
|
185
|
+
|
|
186
|
+
assert (
|
|
187
|
+
_is_in_probation(
|
|
188
|
+
{"routing_score": 0.5, "scoring_state": "probation"}, archive=False
|
|
189
|
+
)
|
|
190
|
+
is True
|
|
191
|
+
)
|
|
192
|
+
assert (
|
|
193
|
+
_is_in_probation(
|
|
194
|
+
{"routing_score": 0.0, "scoring_state": "active"}, archive=False
|
|
195
|
+
)
|
|
196
|
+
is False
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
def test_is_in_probation_falls_back_to_zero_score_when_state_missing(self):
|
|
200
|
+
from cli.commands.leaderboard import _is_in_probation
|
|
185
201
|
|
|
186
|
-
assert
|
|
187
|
-
assert
|
|
188
|
-
assert
|
|
202
|
+
assert _is_in_probation({"routing_score": 0.0}, archive=False) is True
|
|
203
|
+
assert _is_in_probation({"routing_score": None}, archive=False) is False
|
|
204
|
+
assert _is_in_probation({}, archive=False) is False
|
|
189
205
|
|
|
190
|
-
def
|
|
191
|
-
from cli.commands.leaderboard import
|
|
206
|
+
def test_is_in_probation_uses_archive_score_in_archive_mode(self):
|
|
207
|
+
from cli.commands.leaderboard import _is_in_probation
|
|
192
208
|
|
|
193
209
|
node = {"routing_score": 1.0, "routing_score_archive": 0.0}
|
|
194
|
-
assert
|
|
195
|
-
assert
|
|
210
|
+
assert _is_in_probation(node, archive=True) is True
|
|
211
|
+
assert _is_in_probation(node, archive=False) is False
|
|
196
212
|
|
|
197
|
-
def
|
|
213
|
+
def test_render_default_shows_probation_marker_without_literal_markup(
|
|
198
214
|
self, monkeypatch
|
|
199
215
|
):
|
|
200
216
|
from cli.commands import leaderboard
|
|
@@ -216,7 +232,8 @@ class TestRehabDisplay:
|
|
|
216
232
|
"nodes": [
|
|
217
233
|
{
|
|
218
234
|
"node_id": "node-12345678",
|
|
219
|
-
"routing_score": 0.
|
|
235
|
+
"routing_score": 0.1,
|
|
236
|
+
"scoring_state": "probation",
|
|
220
237
|
"latency_score": 1.0,
|
|
221
238
|
"reliability": 1.0,
|
|
222
239
|
"price_factor": 1.0,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|