import sys
def _safe(label, fn):
try:
return f" {label}: {fn()!r}"
except Exception as e:
return f" {label}: <error: {type(e).__name__}: {e}>"
print("=" * 60)
print("Jumperless V5 firmware probe")
print("=" * 60)
print("\n[1] System identity")
print(_safe("sys.platform", lambda: sys.platform))
print(_safe("sys.implementation", lambda: sys.implementation))
print(_safe("sys.version", lambda: sys.version))
try:
import os
print(_safe("os.uname", lambda: os.uname()))
except Exception as e:
print(f" os.uname: <error: {type(e).__name__}: {e}>")
print("\n[2] Gating check: cooperative-yield primitive")
try:
import jumperless as j
has_force = hasattr(j, "force_service")
print(f" jumperless.force_service present: {has_force}")
if has_force:
print(" -> Verdict: likely JumperlOS firmware")
else:
print(" -> Verdict: likely RP23V50firmware (stable)")
except Exception as e:
print(f" <error importing jumperless: {type(e).__name__}: {e}>")
raise SystemExit(1)
print("\n[3] API surface fingerprint")
indicators = [
"force_service",
"jOS",
"connect",
"disconnect",
"nodes_save",
"set_net_color",
"set_net_color_hsv",
"overlay_set_pixel",
"overlay_clear_all",
"run_app",
"probe_read",
"probe_read_nonblocking",
"clickwheel_get_press",
"clickwheel_get_rotation",
"wavegen_is_running",
"la_is_capturing",
"jfs",
]
for name in indicators:
print(f" jumperless.{name}: {hasattr(j, name)}")
print("\n[4] jumperless.jfs submodule")
try:
from jumperless import jfs
jfs_attrs = [
"open", "read", "write", "close", "flush", "sync",
"remove", "rename", "mkdir", "rmdir",
"stat", "exists", "info", "available", "listdir",
]
for attr in jfs_attrs:
print(f" jfs.{attr}: {hasattr(jfs, attr)}")
except Exception as e:
print(f" <error: {type(e).__name__}: {e}>")
print("\n[5] jOS namespace (JumperlOS marker)")
try:
has_jOS = hasattr(j, "jOS")
print(f" jumperless.jOS present: {has_jOS}")
if has_jOS:
jOS_attrs = sorted(a for a in dir(j.jOS) if not a.startswith("_"))
print(f" jOS attr count: {len(jOS_attrs)}")
for a in jOS_attrs:
print(f" jOS.{a}")
except Exception as e:
print(f" <error: {type(e).__name__}: {e}>")
print("\n[6] Filesystem script-directory hints")
hint_paths = [
"/python_scripts/",
"/python_scripts/ex/",
"/python_scripts/ex/interaction_demo.py",
"/python_scripts/ex/stylophone.py",
"/python_scripts/lib/",
"/python_scripts/lib/jumperless_mcp/", "/python_scripts/lib/jumperless_mcp/VERSION",
"/boot.py",
"/main.py",
]
try:
from jumperless import jfs
for p in hint_paths:
try:
exists = jfs.exists(p)
print(f" {p}: {exists}")
except Exception as e:
print(f" {p}: <error: {type(e).__name__}: {e}>")
except Exception as e:
print(f" <jfs unavailable for path checks: {type(e).__name__}: {e}>")
print("\n[7] Full public dir(jumperless)")
try:
attrs = sorted(a for a in dir(j) if not a.startswith("_"))
print(f" count: {len(attrs)}")
for a in attrs:
print(f" {a}")
except Exception as e:
print(f" <error: {type(e).__name__}: {e}>")
print("\n[8] Resident jumperless_mcp library")
try:
from jumperless import jfs as _jfs
if _jfs.exists("/python_scripts/lib/jumperless_mcp/VERSION"):
_f = _jfs.open("/python_scripts/lib/jumperless_mcp/VERSION", "r")
try:
_v = _jfs.read(_f, 256)
if isinstance(_v, bytes):
_v = _v.decode("utf-8", "replace")
print(f" VERSION file: {_v.strip()!r}")
finally:
_jfs.close(_f)
else:
print(" VERSION file: <not installed>")
except Exception as e:
print(f" <error: {type(e).__name__}: {e}>")
print("\n[9] jOS namespace clarification")
try:
import jOS as _jOS_top _attrs = sorted(a for a in dir(_jOS_top) if not a.startswith("_"))
print(f" import jOS: OK ({type(_jOS_top).__name__}, {len(_attrs)} public attrs)")
for _a in _attrs[:40]:
print(f" jOS.{_a}")
if len(_attrs) > 40:
print(f" ... (+{len(_attrs) - 40} more)")
except ImportError as _e:
print(f" import jOS: FAIL ({_e})")
except Exception as _e:
print(f" import jOS: unexpected {type(_e).__name__}: {_e}")
_fs = getattr(j, "force_service", None)
if _fs is not None:
print(f" type(force_service): {type(_fs).__name__}")
print(f" callable: {callable(_fs)}")
_fs_attrs = [a for a in dir(_fs) if not a.startswith("_")]
if _fs_attrs:
print(f" force_service attrs: {_fs_attrs}")
import sys as _sys
_jOS_keys = [k for k in _sys.modules.keys() if "jOS" in k or "jos" in k.lower()]
print(f" sys.modules jOS matches: {_jOS_keys}")
print(" j.help() output:")
try:
_help = getattr(j, "help", None)
if callable(_help):
_help()
elif _help is not None:
print(f" {_help!r}")
else:
print(" j.help unavailable")
except Exception as _e:
print(f" j.help error: {type(_e).__name__}: {_e}")
print("\n" + "=" * 60)
print("Probe complete")
print("=" * 60)