Skip to content

fix(install): bridge system/ → .hex/ for v0.16+ binary; revert premature .legacy rename#6

Open
arrra wants to merge 1 commit into
mrap:mainfrom
arrra:fix/v016-install-layout-and-legacy-bridge
Open

fix(install): bridge system/ → .hex/ for v0.16+ binary; revert premature .legacy rename#6
arrra wants to merge 1 commit into
mrap:mainfrom
arrra:fix/v016-install-layout-and-legacy-bridge

Conversation

@arrra
Copy link
Copy Markdown

@arrra arrra commented May 19, 2026

Summary

The v0.16.0 release ("Real-port phase complete") introduced two regressions that break a fresh install:

  1. Layout mismatch. The Rust hex binary has hardcoded path constants that prefix system/skills/... and system/scripts/... (verified via strings system/scripts/bin/hex). But install.sh copies foundation's system/* into \$TARGET_DIR/.hex/* and never creates a system/ entry at the install root — so hex memory index/search, hex doctor, and hex integration all fail on a fresh install with:
    python3: can't open file '/<install>/system/skills/memory/scripts/memory_index.py': [Errno 2] No such file or directory
    bash: /<install>/system/scripts/hex-doctor: No such file or directory
    
  2. Premature .legacy quarantine. memory_index, memory_search, and startup were renamed to .legacy.* but they are still invoked at runtime:
    • hex memory index|search shells out to memory_index.py / memory_search.py (Rust subcommand is a wrapper, not a port).
    • The Memory System section in this repo's CLAUDE.md and system/skills/memory/SKILL.md both still document the non-.legacy paths.
    • system/skills/hex-startup/SKILL.md runs \$HEX_DIR/.hex/scripts/startup.sh.

Changes

  • install.sh: add ln -sfn .hex \"\$TARGET_DIR/system\" alongside the existing .agents/skills → .hex/skills symlink. Same pattern, additive fix.
  • Rename system/skills/memory/scripts/memory_index.legacy.pymemory_index.py
  • Rename system/skills/memory/scripts/memory_search.legacy.pymemory_search.py
  • Rename system/scripts/startup.legacy.shstartup.sh

Total: 4 files changed, 7 insertions(+).

Test plan

Verified on a real install (workspace at `/Users/sagarsingh/hex`, hex 0.8.0 commit 9412f85):

  • Reproduced both failure modes (hex memory index, hex doctor --smoke, missing startup.sh) before applying the fix
  • Applied the equivalent symlinks locally (without modifying upstream files) and confirmed:
    • hex memory indexDone in 0.02s: 0 indexed, 327 unchanged, 0 removed
    • hex doctor --smoke --quiet → runs to completion (1 unrelated warning)
    • which hex → resolves via \$HEX_DIR/.hex/bin/hex
    • bash \$HEX_DIR/.hex/scripts/startup.sh → runs the legacy script transparently
  • Reviewer should run bash install.sh /tmp/hex-test on a clean dir to verify install lays out correctly
  • Reviewer should run cd /tmp/hex-test && \$PWD/.hex/bin/hex memory index to verify the binary resolves the new symlink

Notes

  • Discovered while running /hex-upgrade then /hex-startup post-v0.16.0 upgrade. Standing Order S1 ("sync fixes to hex base") motivated upstreaming.
  • Alternative fixes considered:
    • Patch the Rust binary's path resolver to look at .hex/... (correct but requires re-release).
    • Change install.sh to copy system/* to \$TARGET_DIR/system/* instead of .hex/* (more invasive — breaks every existing instance's directory expectations).
  • This minimal-symlink approach matches the existing .agents/skills pattern and is fully reversible.

🤖 Generated with Claude Code

…ure .legacy rename

The v0.16.0 release ("Real-port phase complete") renamed three actively-used
scripts to `.legacy` AND assumes a layout the install.sh does not produce.
Two separate bugs in one release:

1. **Layout mismatch.** The Rust `hex` binary has hardcoded path constants
   that prefix `system/skills/...` and `system/scripts/...` (verified via
   `strings system/scripts/bin/hex`). install.sh copies foundation's
   `system/*` to `$TARGET_DIR/.hex/*` and never creates a `system/` entry
   at the install root — so `hex memory index/search`, `hex doctor`, and
   `hex integration` all fail with `No such file or directory` on a fresh
   install. Add `ln -sfn .hex "$TARGET_DIR/system"` alongside the existing
   `.agents/skills → .hex/skills` symlink. Same pattern, additive fix.

2. **Premature `.legacy` quarantine.** memory_index, memory_search, and
   startup are not legacy — they are still invoked at runtime:
   - `hex memory index|search` shells out to memory_index.py/memory_search.py
     (the Rust subcommand is a wrapper, not a port).
   - SKILL.md (Memory System section) and the foundation CLAUDE.md memory
     instructions both reference the non-`.legacy` paths.
   - hex-startup SKILL.md runs `.hex/scripts/startup.sh`.
   Rename them back to canonical names so existing tooling and the binary
   both find them.

Verified on a real install (Sagar's hex instance): with this branch applied
locally via symlinks, `hex memory index` indexes 327 files cleanly,
`hex doctor --smoke` runs to completion, and `startup.sh` is resolvable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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