From 5267dc81893fa1d6488fdfe777946de463aa30d4 Mon Sep 17 00:00:00 2001 From: Sagar Singh Date: Tue, 19 May 2026 15:48:07 -0700 Subject: [PATCH] =?UTF-8?q?fix(install):=20bridge=20system/=20=E2=86=92=20?= =?UTF-8?q?.hex/=20for=20v0.16+=20binary;=20revert=20premature=20.legacy?= =?UTF-8?q?=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- install.sh | 7 +++++++ system/scripts/{startup.legacy.sh => startup.sh} | 0 .../scripts/{memory_index.legacy.py => memory_index.py} | 0 .../scripts/{memory_search.legacy.py => memory_search.py} | 0 4 files changed, 7 insertions(+) rename system/scripts/{startup.legacy.sh => startup.sh} (100%) rename system/skills/memory/scripts/{memory_index.legacy.py => memory_index.py} (100%) rename system/skills/memory/scripts/{memory_search.legacy.py => memory_search.py} (100%) diff --git a/install.sh b/install.sh index ede09b2..a228a0a 100755 --- a/install.sh +++ b/install.sh @@ -141,6 +141,13 @@ fi mkdir -p "$TARGET_DIR/.agents" ln -sfn ../.hex/skills "$TARGET_DIR/.agents/skills" +# Symlink system/ → .hex/ so the hex Rust binary (v0.16+) resolves its hardcoded +# "system/skills/...", "system/scripts/..." paths against the install layout. +# Without this, `hex memory index/search`, `hex doctor`, and `hex integration` +# all fail with "No such file or directory" because the binary's path resolver +# was built against the foundation source-tree layout, not the install layout. +ln -sfn .hex "$TARGET_DIR/system" + # Seed optional configs doctor expects. Defaults are safe and overridable later. echo '{}' > "$TARGET_DIR/.hex/settings.json" diff --git a/system/scripts/startup.legacy.sh b/system/scripts/startup.sh similarity index 100% rename from system/scripts/startup.legacy.sh rename to system/scripts/startup.sh diff --git a/system/skills/memory/scripts/memory_index.legacy.py b/system/skills/memory/scripts/memory_index.py similarity index 100% rename from system/skills/memory/scripts/memory_index.legacy.py rename to system/skills/memory/scripts/memory_index.py diff --git a/system/skills/memory/scripts/memory_search.legacy.py b/system/skills/memory/scripts/memory_search.py similarity index 100% rename from system/skills/memory/scripts/memory_search.legacy.py rename to system/skills/memory/scripts/memory_search.py