Skip to content

feat(install): one-line zero-friction install + packaged tui bundle#8

Merged
arelchan merged 1 commit into
mainfrom
chenweixiang/one-line-install
Jun 30, 2026
Merged

feat(install): one-line zero-friction install + packaged tui bundle#8
arelchan merged 1 commit into
mainfrom
chenweixiang/one-line-install

Conversation

@arelchan

@arelchan arelchan commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Change description

Make raven / raven tui runnable from any directory after a single install — no manual cd / uv run / npm build / Node setup.

  • pyproject.toml + hatch_build.py: a custom build hook conditionally packages ui-tui/dist into the wheel as raven/ui-tui/dist when the bundle exists. A static force-include would hard-fail when dist/ is absent (it's gitignored), breaking git clone && uv sync; the hook degrades gracefully with a warning instead.
  • raven/cli/tui_commands.py: resolve_dist_entry() locates entry.js packaged-first then source-tree; find_node() adds a Priority-4 fallback to a Raven-managed private Node under ~/.raven/runtime; --dev still requires the source tree, production no longer does.
  • install.sh (new): POSIX one-line installer — ensures uv, ensures Node>=22 (downloads a private runtime if missing), installs raven as a global uv tool. Hardened: verifies the Node tarball against SHASUMS256.txt, self-tests the downloaded node (glibc/musl), validates a cached node before reuse, guards unset HOME.
  • .github/workflows/release.yml (new, DRAFT): on tag, build entry.js then the wheel, asserting the bundle ships and node_modules/src do not.

Verification

  • wheel contains exactly raven/ui-tui/dist/entry.js (no node_modules/src)
  • clean-venv install + raven tui --check exits 0 from an unrelated dir
  • private-Node download + find_node Priority-4 discovery confirmed
  • conditional hook verified both ways (with dist → packaged; without dist → builds + warns, no crash)

Type of change

  • Bug fix
  • New feature
  • Others (packaging / tooling)

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer
  • Pull request linked to JIRA ticket when applicable

@arelchan
arelchan force-pushed the chenweixiang/one-line-install branch 2 times, most recently from 36e239c to 03e3c0c Compare June 29, 2026 16:01
@arelchan
arelchan requested a review from cyfyifanchen June 30, 2026 05:14
@cyfyifanchen
cyfyifanchen requested review from JasonJarvan and removed request for cyfyifanchen June 30, 2026 06:07
@arelchan
arelchan force-pushed the chenweixiang/one-line-install branch from 03e3c0c to 6b0a178 Compare June 30, 2026 06:27
@arelchan arelchan changed the title feat(install): 一键零摩擦安装 + TUI 产物随 wheel 分发 feat(install): one-line zero-friction install + packaged tui bundle Jun 30, 2026
@arelchan
arelchan force-pushed the chenweixiang/one-line-install branch from 6b0a178 to cdc8138 Compare June 30, 2026 06:31
Make `raven` / `raven tui` work from any directory after a single install
command, with no manual cd / uv run / npm build / Node setup -- for both
end users (curl | sh) and open-source developers (git clone && ./install.sh).

Why
---
Today `raven tui` only runs from a source checkout: the ui-tui bundle isn't
packaged into the wheel, the launcher locates it via a source-tree-relative
path, and there is no Node provisioning. A `pip`/`uv tool install` therefore
yields a broken `raven tui`.

What changed (all additive; no core/Spine/agent-loop changes)
-------------------------------------------------------------
1. pyproject.toml + hatch_build.py -- a custom build hook conditionally
   packages ui-tui/dist into the wheel as raven/ui-tui/dist when the
   bundle exists, so installs ship the prebuilt self-contained entry.js
   (no node_modules, no src). A static force-include would hard-fail when
   dist/ is absent (it's gitignored), breaking `git clone && uv sync`;
   the hook degrades gracefully with a warning instead.

2. raven/cli/tui_commands.py
   - new resolve_dist_entry(): locate entry.js packaged-first, then
     source-tree; production launch uses it instead of a hardcoded path.
   - find_node(): add Priority-4 fallback to a Raven-managed private Node
     under ~/.raven/runtime (zero PATH config needed).
   - --dev still requires the source tree; production no longer does.

3. install.sh (new) -- POSIX one-line installer: ensures uv, ensures
   Node>=22 (downloads a private runtime if the system lacks it),
   installs raven as a global uv tool. Idempotent; local + remote modes.
   Hardened: verifies the Node tarball against the official SHASUMS256.txt
   before extracting (supply-chain integrity); self-tests the downloaded
   node (catches glibc/musl mismatch at install time); validates a cached
   private node actually runs before reusing it; fails with a clear message
   when HOME is unset; anchors the version regex.

4. .github/workflows/release.yml (new, DRAFT) -- on tag, build entry.js
   then the wheel, with a sanity gate asserting the bundle is shipped and
   node_modules/src are not. This keeps entry.js self-maintaining: every
   release rebuilds it from current ui-tui source, so it can't drift.

Verified
--------
- wheel contains exactly raven/ui-tui/dist/entry.js (no node_modules/src)
- clean-venv install + `raven tui --check` exits 0 from an unrelated dir
  (resolve_dist_entry picks the packaged copy; source tree absent)
- private-Node path: download + find_node Priority-4 discovery confirmed
  with the system Node hidden
- existing 27 TUI tests pass

Not in this change (follow-ups for the remote one-liner to go live)
-------------------------------------------------------------------
- run the release workflow to publish a wheel that contains entry.js
- host install.sh at raven.evermind.ai
- README Install section update
- Windows install.ps1

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arelchan
arelchan force-pushed the chenweixiang/one-line-install branch from cdc8138 to 55bf4f4 Compare June 30, 2026 06:36
@arelchan
arelchan merged commit a1aea18 into main Jun 30, 2026
6 checks passed
@arelchan
arelchan deleted the chenweixiang/one-line-install branch June 30, 2026 06:51
Kendrick-Song added a commit that referenced this pull request Jul 22, 2026
- Move _everos_server.py from raven/cli/ to raven/plugin/memory/everos/
  _server.py to fix plugin->cli layering violation (CR #1)
- Split HTTP timeout: client default 60s (recall/health), memorize
  add/flush per-request 360s (CR #2)
- Defer backend.start() to post-handshake background task in TUI so
  first render is not blocked by server startup (CR #3)
- Remove unused app_id/project_id from ImportSession and scanner
  (CR #4)
- Add note on per-source-unit checkpoint granularity (CR #5)
- Add fcntl file lock to prevent concurrent server spawn race (CR #6)
- Fix loguru %s format to {} in state.py (CR #7)
- Fix docstring step numbering (CR #8)
- Remove redundant Table import in status_cmd (CR #9)

Co-authored-by: Claude (claude-opus-4-6) <noreply@anthropic.com>
Kendrick-Song added a commit that referenced this pull request Jul 22, 2026
- Move _everos_server.py from raven/cli/ to raven/plugin/memory/everos/
  _server.py to fix plugin->cli layering violation (CR #1)
- Split HTTP timeout: client default 60s (recall/health), memorize
  add/flush per-request 360s (CR #2)
- Defer backend.start() to post-handshake background task in TUI so
  first render is not blocked by server startup (CR #3)
- Remove unused app_id/project_id from ImportSession and scanner
  (CR #4)
- Add note on per-source-unit checkpoint granularity (CR #5)
- Add fcntl file lock to prevent concurrent server spawn race (CR #6)
- Fix loguru %s format to {} in state.py (CR #7)
- Fix docstring step numbering (CR #8)
- Remove redundant Table import in status_cmd (CR #9)

Co-authored-by: Claude (claude-opus-4-6) <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