Complete the alpha-hardening Ralph task set, including tracker billing/accounting guards, validator fraud-audit primitives, wallet binding proof support, documentation runbooks, and updated tests. Verification: .venv/bin/python -m compileall -q packages tests; .venv/bin/python -m pytest -q --tb=short (313 passed, 3 skipped, 1 failed: tests/test_mining_cli.py::test_legacy_start_without_port_uses_next_available_port because meshnet-node pid 1263451 is already listening on port 7000).
2.8 KiB
2.8 KiB
Status: done
19 — DOC: Cryptography dependency + test environment note
What to build
Document and verify test/dev environment setup for wallet crypto paths. packages/node/meshnet_node/wallet.py uses cryptography; failures occur when .venv lacks deps. cryptography>=41 is already declared in packages/node/pyproject.toml, so this issue should focus on documenting the editable-install path and only add root/dev extras if tests still import the node wallet without installing the node package.
Code refs:
packages/node/pyproject.toml—cryptography>=41(verify declared)packages/node/meshnet_node/wallet.py- Handoff: tests fail without
cryptography,openai,langchainin.venv
Acceptance criteria
- Confirm
cryptography>=41remains in node package deps; add to root/dev extras only if tests import wallet without node install - Add short Test environment section to
docs/dev/test-env.md(orCONTRIBUTING.mdif created): use.venv/Scripts/python.exe,pip install -e packages/node ..., optional dep skips - Note which tests require optional deps (
--ignore=test_openai_gateway,...) - No unrelated production code changes
Blocked by
None
Resolution
packages/node/pyproject.tomlalready declaredcryptography>=41— no change needed.conftest.pyadds everypackages/*dir tosys.path, so first-party imports (e.g.meshnet_node.wallet) resolve without an editable install of that package — but third-party deps likecryptographystill must be installed separately. Addedcryptography>=41to the rootpyproject.tomldevextra sopip install -e ".[dev]"alone covers the wallet tests (test_node_startup.py,test_wallet_binding_proof.py,test_devnet_treasury.py, etc.) without requiring a fullpackages/nodeinstall (which would otherwise pull in torch/transformers/accelerate/bitsandbytes).- Added
docs/dev/test-env.mdwith setup instructions (Linux + Windows.venv\Scripts\python.exe), and a note on optional-dependency tests:test_real_model_backend.py/test_devnet_treasury.pyusepytest.importorskipand skip cleanly;test_openai_gateway.pyhard-importsopenai/langchain_openaiwith no skip guard (both already in thedevextra) — documented the--ignore=tests/test_openai_gateway.pyfallback for minimal installs. - Full suite: 311 passed, 3 skipped, 3 pre-existing failures unrelated to this issue (
test_billing_ledger.py::test_proxy_chat_splits_payout_by_tracker_assigned_route_span,test_forfeiture_penalty.py::test_probation_earns_nothing_then_earning_begins,test_mining_cli.py::test_legacy_start_without_port_uses_next_available_port— port-in-use env artifact). Wallet-specific tests (test_wallet_binding_proof.py,test_node_startup.py,test_devnet_treasury.py): 50 passed, 2 skipped.