Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3795c2757b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [[ -f "${REQ_FILE}" ]]; then | ||
| python -m pip install --no-index --find-links "${WHEEL_DIR}" -r "${REQ_FILE}" |
There was a problem hiding this comment.
Install bitnet-tools before optional requirements
scripts/prepare_online_bundle.sh always writes meta/offline_requirements.txt with only optional packages (matplotlib, pandas, jupyterlab, pytest), so this branch is always taken and bitnet-tools is never installed on a fresh offline host. It also makes optional-wheel download failures fatal at install time, even though the download step is marked best-effort. The installer should install bitnet-tools explicitly (and treat optional deps separately).
Useful? React with 👍 / 👎.
| for path in sorted((bundle / "wheels").glob("*.whl")): | ||
| h = hashlib.sha256(path.read_bytes()).hexdigest() | ||
| rel = path.relative_to(bundle).as_posix() | ||
| assets.append({"path": rel, "sha256": h, "license": "UNKNOWN"}) |
There was a problem hiding this comment.
Include executed requirements file in policy verification
The generated policy only records wheel files (and optionally models/ollama_install.sh), but offline_install.(sh|ps1) later executes meta/offline_requirements.txt via pip -r. Because verify_bundle checks only policy["assets"], edits to offline_requirements.txt are not detected, so a tampered bundle can pass verification and still install attacker-selected packages from wheels/.
Useful? React with 👍 / 👎.
Motivation
Description
bitnet_tools/offline_bundle.pyimplementingverify_bundlewhich validates SHA256, allowlist membership and allowed license rules from ameta/offline_policy.jsonpolicy and returns a structuredviolationsreport.offline_install.shandoffline_install.ps1that callpython -m bitnet_tools.offline_bundle verifyand abort installation with an error if any policy violations are found, then install from local wheels usingpip --no-index.scripts/prepare_online_bundle.shto generatemeta/offline_policy.json(assets + sha256 + allowlist + allowed_licenses) and copyoffline_requirements.txt, and to include instructions for the offline install flow.bitnet_tools.doctor.collect_environmentto includeoffline_readinessvia_collect_offline_readiness, which reportsbundle_dir, required file presence (offline_installscripts,offline_policy,deferred_install_manifest.json),dependencies(e.g.pip), model request/availability and a combinedreadyboolean.README.mdwith the offline bundle creation/install instructions and the verification guarantees.tests/test_offline_bundle.pyandtests/test_doctor.pythat validate policy verification success/failure behaviors and the newoffline_readinesskeys.Testing
pytest -q tests/test_offline_bundle.py tests/test_doctor.py tests/test_cli.py::test_cli_doctor_modeand they passed (5 passed).pytest -qand it succeeded (74 passed).Codex Task