Point Naldo_Bot's brain at the Mine Space
Browse files
tests/test_voyager_documentation_conformance.py
CHANGED
|
@@ -373,14 +373,53 @@ def test_the_auxiliary_roles_keep_the_small_model():
|
|
| 373 |
def test_the_brain_lock_matches_what_the_stack_starts():
|
| 374 |
# voyager_runner refuses to learn if the model it was told to use is not the
|
| 375 |
# one the stack configured, so these two must agree exactly.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 376 |
runner = (ROOT / "voyager_runner.py").read_text(encoding="utf-8")
|
| 377 |
stack = (ROOT / "voyager_stack.py").read_text(encoding="utf-8")
|
| 378 |
-
assert '"
|
| 379 |
-
assert '"
|
| 380 |
assert (
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
|
| 385 |
|
| 386 |
def test_the_previous_brain_alias_still_resolves():
|
|
|
|
| 373 |
def test_the_brain_lock_matches_what_the_stack_starts():
|
| 374 |
# voyager_runner refuses to learn if the model it was told to use is not the
|
| 375 |
# one the stack configured, so these two must agree exactly.
|
| 376 |
+
#
|
| 377 |
+
# The brain moved to the separate Space Erinaldordso/Mine: inference no
|
| 378 |
+
# longer runs here, so the lock now guards the public URL of that Space
|
| 379 |
+
# instead of loopback.
|
| 380 |
runner = (ROOT / "voyager_runner.py").read_text(encoding="utf-8")
|
| 381 |
stack = (ROOT / "voyager_stack.py").read_text(encoding="utf-8")
|
| 382 |
+
assert '"VOYAGER_BRAIN_MODEL", "qwen3-coder-30b-a3b-instruct"' in stack
|
| 383 |
+
assert '"VOYAGER_BRAIN_AUX_MODEL", "granite-4.0-h-tiny"' in stack
|
| 384 |
assert (
|
| 385 |
+
"https://erinaldordso-mine.hf.space/v1"
|
| 386 |
+
in stack
|
| 387 |
+
), "the stack must point the brain at the Mine Space"
|
| 388 |
+
assert (
|
| 389 |
+
'"https://erinaldordso-mine.hf.space/v1",\n'
|
| 390 |
+
' "qwen3-coder-30b-a3b-instruct",\n'
|
| 391 |
+
' "granite-4.0-h-tiny",'
|
| 392 |
+
) in runner, "the brain lock must expect the Mine Space brain"
|
| 393 |
+
|
| 394 |
+
|
| 395 |
+
def test_the_brain_lock_has_an_escape_hatch():
|
| 396 |
+
# The lock kills the process and the watchdog restarts it in a loop, so a
|
| 397 |
+
# bad deploy leaves the bot permanently down. VOYAGER_BRAIN_LOCK=off must
|
| 398 |
+
# disable the check without a rebuild.
|
| 399 |
+
runner = (ROOT / "voyager_runner.py").read_text(encoding="utf-8")
|
| 400 |
+
stack = (ROOT / "voyager_stack.py").read_text(encoding="utf-8")
|
| 401 |
+
assert 'env("VOYAGER_BRAIN_LOCK", "enforce") != "off"' in runner
|
| 402 |
+
assert '"VOYAGER_BRAIN_LOCK"' in stack
|
| 403 |
+
# The lock must be skipped, not merely warned about.
|
| 404 |
+
assert "if expected and brain_lock and" in runner
|
| 405 |
+
|
| 406 |
+
|
| 407 |
+
def test_the_auxiliary_roles_are_served_by_the_remote_brain():
|
| 408 |
+
# Curriculum QA and skill description used to run on a local granite copy.
|
| 409 |
+
# Both models now come from the Mine Space, so no model weights remain in
|
| 410 |
+
# the Space that hosts the game.
|
| 411 |
+
stack = (ROOT / "voyager_stack.py").read_text(encoding="utf-8")
|
| 412 |
+
assert 'BRAIN_AUX_MODEL = os.environ.get("VOYAGER_BRAIN_AUX_MODEL", "granite-4.0-h-tiny")' in stack
|
| 413 |
+
assert '"qa": BRAIN_AUX_MODEL' in stack
|
| 414 |
+
assert '"skill_manager": BRAIN_AUX_MODEL' in stack
|
| 415 |
+
|
| 416 |
+
|
| 417 |
+
def test_no_local_inference_endpoint_is_hardcoded():
|
| 418 |
+
# Regression guard: the old loopback URL must not come back. With the model
|
| 419 |
+
# gone from this Space, 127.0.0.1:7860/v1 would point at nothing.
|
| 420 |
+
stack = (ROOT / "voyager_stack.py").read_text(encoding="utf-8")
|
| 421 |
+
assert '"VOYAGER_OPENAI_BASE": "http://127.0.0.1:7860/v1"' not in stack
|
| 422 |
+
assert '"openai_base": "http://127.0.0.1:7860/v1"' not in stack
|
| 423 |
|
| 424 |
|
| 425 |
def test_the_previous_brain_alias_still_resolves():
|