harden(neuron-dev-setup): fix 7 fresh-Mac onboarding installer bugs #99

Merged
will.anderson merged 1 commits from feat/neuron-dev-setup-hardening into feat/neuron-dev-setup 2026-07-22 21:49:32 +00:00
Owner

Hardens the neuron-dev-setup installer with 7 fixes found while dry-running fresh-Mac onboarding. Stacked on #84 so this diff is just the fixes.

Fixes

  1. Headless keychain hang — the Anthropic-key prompt (read -s) hung forever when stdin isn't a TTY. Now guarded with [ -t 0 ]: interactive prompts as before, headless/CI dies fast with a clear message to set ANTHROPIC_API_KEY.
  2. Wrong engram health path — health checks hit /api/health; engram serves /health. Fixed in the Phase 6 wait, Phase 8 verify, and printed hints (soul's correct /health and engram's /api/nodes data path untouched).
  3. MCP registered in the wrong file — installer wrote ~/.claude/mcp.json, but Claude Code reads MCP servers from ~/.claude.json (mcpServers). Now jq deep-merges the neuron entry into ~/.claude.json, preserving other servers and top-level keys (templated port kept intact).
  4. settings.json hooks not merged — an existing ~/.claude/settings.json only got a settings.core.json to merge by hand. Now jq-merges the neuron hooks (dropping doc-only // keys), preserving the user's settings; idempotent on re-run.
  5. Nonexistent foundation.git — removed the foundation.git clone and the forge build that depended on it. Phase 6 genesis seeding already degrades to a warning when forge/seed are absent.
  6. No non-GCP build fallback — the El-toolchain step did die when gcloud was missing. Now it warns and continues; native builds are guarded on the El runtime/elc being present, so a fresh Mac without GCP still completes the install (services + Claude config laid down) with guidance to finish later.
  7. Forge seed hardcoded /Users/will — the soul studio_dir default baked /Users/will/.... Now derived from $HOME (soul.el + the committed dist/soul.c, dist/neuron.c, dist/soul-with-nlg.el artifacts). /Users/will no longer appears anywhere in the tree.

Also adds jq to the preflight tool list (required by fixes 3 and 4).

Removing the foundation.git clone and the gcloud-or-die step should clear the build failure on #84.

Hardens the `neuron-dev-setup` installer with 7 fixes found while dry-running fresh-Mac onboarding. Stacked on #84 so this diff is just the fixes. ### Fixes 1. **Headless keychain hang** — the Anthropic-key prompt (`read -s`) hung forever when stdin isn't a TTY. Now guarded with `[ -t 0 ]`: interactive prompts as before, headless/CI dies fast with a clear message to set `ANTHROPIC_API_KEY`. 2. **Wrong engram health path** — health checks hit `/api/health`; engram serves `/health`. Fixed in the Phase 6 wait, Phase 8 verify, and printed hints (soul's correct `/health` and engram's `/api/nodes` data path untouched). 3. **MCP registered in the wrong file** — installer wrote `~/.claude/mcp.json`, but Claude Code reads MCP servers from `~/.claude.json` (`mcpServers`). Now jq deep-merges the `neuron` entry into `~/.claude.json`, preserving other servers and top-level keys (templated port kept intact). 4. **settings.json hooks not merged** — an existing `~/.claude/settings.json` only got a `settings.core.json` to merge by hand. Now jq-merges the neuron `hooks` (dropping doc-only `//` keys), preserving the user's settings; idempotent on re-run. 5. **Nonexistent `foundation.git`** — removed the `foundation.git` clone and the `forge` build that depended on it. Phase 6 genesis seeding already degrades to a warning when forge/seed are absent. 6. **No non-GCP build fallback** — the El-toolchain step did `die` when `gcloud` was missing. Now it warns and continues; native builds are guarded on the El runtime/`elc` being present, so a fresh Mac without GCP still completes the install (services + Claude config laid down) with guidance to finish later. 7. **Forge seed hardcoded `/Users/will`** — the soul `studio_dir` default baked `/Users/will/...`. Now derived from `$HOME` (`soul.el` + the committed `dist/soul.c`, `dist/neuron.c`, `dist/soul-with-nlg.el` artifacts). `/Users/will` no longer appears anywhere in the tree. Also adds `jq` to the preflight tool list (required by fixes 3 and 4). Removing the `foundation.git` clone and the `gcloud`-or-die step should clear the build failure on #84.
will.anderson added 1 commit 2026-07-22 20:58:09 +00:00
- Guard the Anthropic key prompt with `[ -t 0 ]` so headless/CI runs fail
  fast instead of hanging forever on `read -s` with no TTY.
- Hit engram's real health endpoint `/health` (was `/api/health`) in the
  Phase 6 wait, Phase 8 verify, and the printed hints.
- Register the neuron MCP server by jq-merging into ~/.claude.json
  (mcpServers) — the file Claude Code actually reads — not ~/.claude/mcp.json.
- Merge neuron hooks into an existing ~/.claude/settings.json via jq
  (preserving the user's settings, dropping doc-only keys) instead of only
  leaving a settings.core.json to merge by hand.
- Drop the nonexistent foundation.git clone and the forge build that
  depended on it; Phase 6 genesis seeding already degrades to a warning.
- Add a non-GCP fallback: without gcloud (or a staged El toolchain) the
  installer skips the native builds with clear guidance instead of dying,
  so a fresh Mac still completes.
- Template the soul studio_dir default off $HOME instead of a hardcoded
  /Users/will path (soul.el + committed dist artifacts).

Add jq to the preflight tool list (required by the two config merges).
will.anderson merged commit 3ae07cc7b0 into feat/neuron-dev-setup 2026-07-22 21:49:32 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron#99