Raven-1/docs-site/docs/self-hosting.md
userName20260323 e708f34a91
docs: align bilingual documentation with runtime behavior (#551)
## Summary

- Align English and Chinese documentation for Docker/Compose, sandbox
execution, and the in-tree tracing API with verified runtime behavior.
- Separate proactivity usage guidance from developer design and
implementation details, with configuration, troubleshooting, cost, and
safety boundaries.
- Update navigation and remove redundant section separators. Keep page
URLs unchanged.
- Preserve published proactivity section and title anchors in both
languages. Use native aliases for same-page content and visible
migration links for moved sections, with regression tests.
- Clarify Sentinel delivery fallback and menu-selection requirements,
tracing-on/off argument handling, headless CLI menu output, and viewer
descriptor lookup. Add focused regression coverage without changing
runtime behavior.
- Clarify the initial frozen baseline and improve Evolver wording in the
bilingual site and repository mapping. Keep its structure, navigation,
implementation terms, and technical claims unchanged; broader Evolver
documentation work is excluded.
- No runtime changes.

## Type

- [ ] Fix
- [ ] Feature
- [x] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other

## Verification

Passed on the rebased revision:

```bash
uv run --frozen --no-sync pytest tests/test_docs_site.py tests/test_tracing_api.py tests/test_sandbox_unit.py tests/test_sentinel_runner.py tests/test_sentinel_planner.py tests/test_sentinel_fast_path.py tests/test_nudge_policy.py tests/test_proactive_spawn.py tests/test_core_sentinel_stack.py tests/test_core_cron_stack_ledger.py tests/test_cli_sentinel_commands.py tests/test_decision_router.py -q -n 0 -x
# 395 passed

uv run --frozen --no-sync --with 'mkdocs-material>=9.5' --with 'mkdocs-static-i18n>=1.0' --with 'mkdocs-git-revision-date-localized-plugin>=1.6.0' --with 'jieba>=0.42.1' mkdocs build -f docs-site/mkdocs.yml --strict --site-dir /tmp/raven-pr551-push.9ZfOEi/site
# Strict English and Chinese builds passed

UV_NO_SYNC=1 make lint-python PYTHON_LINT_TARGETS='tests/test_docs_site.py tests/test_tracing_api.py tests/test_decision_router.py tests/test_cli_sentinel_commands.py'
UV_NO_SYNC=1 make check-large-files check-source-language COMMIT_RANGE=origin/main..HEAD
PYTHONPATH=. uv run --frozen --no-sync python scripts/check_commit_messages.py origin/main..HEAD
npm exec --yes --package=@commitlint/cli@21.1.0 -- commitlint --from origin/main --to HEAD --config commitlint.config.cjs
git diff --check origin/main...HEAD
# All passed
```

- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed

Documentation checks also covered bilingual examples and the proactivity
JSON configuration schema. A built-HTML audit verified all 110
historical proactivity section fragments and four title fragments,
including same-language migration destinations, and found zero broken
internal fragment links across 29 HTML pages (672 links). Replaying
pre-fix content made all four page compatibility cases fail as expected.
The new descriptor-directory test failed on all three documents before
their stale paths were corrected. Added coverage exercises tracing
on/off, bare-number versus explicit menu selection with incomplete
classifier configuration, and discovery-menu dispatch through the real
CLI stack's headless sink. Runtime type checks and the full repository
test suite were not run; no runtime code changes. No browser click test,
live LLM, real-VM, or container end-to-end run was performed.

## Risk

Documentation-only, with regression tests. Proactivity navigation
changes, but page URLs and historical heading fragments are preserved.
An old link to content moved between pages lands on a visible migration
entry and requires one click to reach the new section; no JavaScript
redirect is needed. Existing queued-nudge policy and external-agent
isolation limitations are described, not fixed. Roll back by reverting
the documentation and associated test changes; no data migration is
involved.

- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes

## Related Issues

N/A

---------

Co-authored-by: zhao.wang <270284818+userName20260323@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-09-20 19:20:27 +08:00

3.6 KiB

Self-Hosting

Run Raven from a local source checkout or deploy it as a Docker Compose service. The Compose deployment serves the WebUI through nginx, runs the Raven engine and its child services in one container, and stores persistent data in a named volume.

Prerequisites

Docker deployment requires Docker Engine and Docker Compose v2. To run from source, install Python 3.12, uv, Node.js, and npm, then install the project dependencies before starting the engine.

Start with Docker Compose

Build and run the current checkout with Compose. It builds the WebUI and Python environment into the image, so neither needs a separate host-side build:

cd docker
docker compose up --build

To run the configured image without building the checkout, use docker compose up --no-build. Plain docker compose up does not guarantee that local source changes are rebuilt.

Open http://127.0.0.1:18793. The container runs the full gateway engine. Model providers added under Settings > Model providers are available on the next turn without a restart.

See Docker Deployment for container services, sign-in, provider setup, and operational guidance.

Configuration

Compose uses the shell environment and docker/.env to interpolate the image, published port, and build arguments. The service's optional docker/.env.local file overrides container runtime variables, such as provider credentials; it is not automatically used for Compose interpolation. Store credentials there, and set build or port overrides in the shell or via explicit --env-file options. See Docker Deployment for examples.

Raven stores configuration, sessions, workspace files, logs, and memory under RAVEN_HOME. In the Compose deployment, this directory is /data/.raven, inside the raven-data volume mounted at /data. Preserve the volume during upgrades and restarts. docker compose down -v deletes the volume and all data it contains.

Build a Docker image

Build the image using the Makefile target:

make docker-build

The default image tag is raven:local. You can set the tag explicitly or choose which optional dependencies to include:

make docker-build DOCKER_IMAGE=raven:local
docker build -t raven:local --build-arg RAVEN_EXTRAS="channels,tools,sandbox" .

To run the local image without rebuilding it, set RAVEN_IMAGE=raven:local and run docker compose up --no-build from docker/. You can export the variable or prefix the command with the assignment. To rebuild and start the checkout through the Makefile instead, use RAVEN_IMAGE=raven:local make docker-up. Stop the services with make docker-down.

Start the server from source

From the repository root:

make install-deps
make build-ui
uv run raven web

raven web opens the WebUI and keeps the engine running after the terminal exits. It defaults to http://127.0.0.1:18792. Use uv run raven web --foreground when debugging, or uv run raven web --stop to stop the background engine. Raven can start before a model is configured; add a provider under Settings > Model providers or run uv run raven onboard.

To start the engine without opening a browser, use uv run raven gateway.