Skip to content

fix: portable author-machine paths + portable-path CI gate#152

Merged
dancinlife merged 1 commit into
mainfrom
fix/portable-path
Jun 1, 2026
Merged

fix: portable author-machine paths + portable-path CI gate#152
dancinlife merged 1 commit into
mainfrom
fix/portable-path

Conversation

@dancinlife

Copy link
Copy Markdown
Contributor

What

Remove machine-absolute author paths so hexa-codex runs on any checkout, and add a CI gate to keep it that way.

Triaged ~50 path hits across lm_foundry/tool/*, tests/*, and a few .hexa files.

(A) Runtime breakage → portable (env → portable default, never a foreign literal)

  • lm_foundry/tool/build_sft_dataset_v{4..14}.py, synth_apple_sft.py — runs root is now $HEXA_RUNS_DIR (default ~/runs), was /home/summer/runs.
  • lm_foundry/tool/hexa_s0_scorer.py — hexa-cc binary via $HEXA_CC_BIN → on-PATH hexa-cc/hexa_v2_linux_x86_64~/.hx/build default; existing fail-fast (bin_path.exists()) preserved.
  • lm_foundry/tool/runpod_launch_7b_sft.sh, recover_hf_uploads.sh — HF-token fetch via $HF_TOKEN_CMD / $HF_TOKEN_HOST (the secret CLI resolved from PATH on the remote, no /Users/ghost/... literal); GGUF/bench paths via $HEXA_RUNS_DIR.

(B) Test fixture → portable placeholder

  • tests/test_install_hexa.py — fallback VM path via $HEXA_BIN / ~/.hx/bin/hexa (still prefers hexa on PATH).

(C) Comment/doc/example → genericized (no foreign literal left)

  • install.hexa, verify/numerics_bitnet_bt77_n6_lattice.hexa, LAB-09/phi_llm_stress_harness.hexa, tests/conftest.py, bench_humaneval.py / score_with_adapter.py docstrings.

Prevention

  • .github/workflows/portable-path-gate.yml — pure-bash PR gate that fails any added non-comment source line introducing /Users/<name>/ or /home/<name>/.

Verification

  • Triage grep over all source globs: 0 remaining hits.
  • py_compile all touched Python: OK. bash -n both shell scripts: OK.
  • Gate simulated against this PR's own diff locally: PASS.
  • Test suite (pytest in a clean venv): 1 failed, 83 passed. The 1 failure (test_install_hexa_runs_clean) is pre-existing on origin/main (verified by running the identical assertion against a pristine checkout) — it's an install.hexa selftest content mismatch ("selftest non-PASS — missing verb spec"), unrelated to path portability. The portability change in that test is exercised and works (the fallback resolves and runs the local VM).

🤖 Generated with Claude Code

Replace hardcoded author-machine absolute paths (/home/summer/runs,
/Users/ghost/..., /Users/mini/...) with portable resolution so the repo
runs on any checkout.

RUNTIME (env -> portable default; never a foreign literal):
- lm_foundry/tool/build_sft_dataset_v{4..14}.py, synth_apple_sft.py:
  runs root now $HEXA_RUNS_DIR, default ~/runs (was /home/summer/runs).
- lm_foundry/tool/hexa_s0_scorer.py: hexa-cc binary resolved via
  $HEXA_CC_BIN -> on-PATH hexa-cc -> ~/.hx/build default; fail-fast kept.
- lm_foundry/tool/runpod_launch_7b_sft.sh, recover_hf_uploads.sh:
  HF-token fetch via $HF_TOKEN_CMD / $HF_TOKEN_HOST (secret CLI from PATH);
  GGUF/bench paths via $HEXA_RUNS_DIR (default ~/runs).

TEST FIXTURE:
- tests/test_install_hexa.py: fallback hexa VM path -> $HEXA_BIN /
  ~/.hx/bin/hexa (still prefers `hexa` on PATH).

COMMENT/DOC:
- install.hexa, verify/numerics_bitnet_bt77_n6_lattice.hexa,
  LAB-09 phi_llm_stress_harness.hexa, tests/conftest.py,
  bench_humaneval.py / score_with_adapter.py docstrings: genericize
  provenance comments / usage examples.

PREVENTION:
- .github/workflows/portable-path-gate.yml: pure-bash PR gate failing any
  ADDED non-comment source line introducing /Users/<name>/ or /home/<name>/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dancinlife dancinlife merged commit b0f68e9 into main Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant