Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ jobs:
python scripts/gen_api_doc.py --check
python scripts/bump_version.py --check
python scripts/check_docs.py
- name: Shell installer syntax
run: bash -n setup.sh
- name: Shell scripts and entry points
run: |
bash -n setup.sh
bash -n setup_termux.sh
python -m compileall -q nerveforge
python nerveforge install --plan > /dev/null

windows:
runs-on: windows-latest
Expand Down
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,72 @@

**English** · [Русский](docs/ru/CHANGELOG.md)

## 8.7.0

The installer stops being three shell scripts that each grew their own answers
and becomes one Python program with the same steps everywhere. That is a
smaller change than it sounds, and a more useful one than it looks: the old
scripts were not wrong, they were separate. `setup.sh` knew about APT,
`setup_termux.sh` about `pkg`, `setup_windows.ps1` about `winget`, and each had
its own idea of what "Python is missing" or "the tunnel is not installed"
should say.

### One program, ten steps, one place to fix a step

`./nerveforge install` runs the same ten steps on Linux, macOS, Windows and
Termux: Python version, administrator rights, tunnel choice, tunnel download,
config and data folders, the working folder, a shortcut, a `nerveforge`
command, a program check, and the start. Each step prints one line saying what
it found — a path, a version, a reason — and the run stops at the first step
that cannot go on, with a remedy on the line below it. A step that fails but
does not block anything (a blocked `cloudflared` download on a machine that
works fine locally) says so and lets the rest continue.

The ten steps live in `installer/actions.py`, the questions in `menu.py`, the
rendering in `render.py`. A new step is a function and an entry in one tuple;
there is no second script to bring in line.

### Three promises the flags keep

- **`--plan` changes nothing.** It goes through the same step table and prints
only the steps that would change the machine, so the plan cannot drift from
the run.
- **`--yes` answers the defaults, and the defaults are quiet.** Shortcuts
default to yes on a desktop and skip themselves on a server or in Termux; the
`nerveforge` command defaults to *no* — it is offered, not assumed. On a
headless machine `--yes` installs nothing beyond the folders the bridge needs.
- **`--uninstall` draws the line at the operator's own content.** It removes
the shortcut, the launcher and the downloaded `cloudflared`. It keeps the
token, the settings, the installed skills and the audit log, and says that it
kept them. An uninstall that deleted a token would be a data-loss bug wearing
an installer's clothes.

### The scripts you have keep working

`setup.sh`, `setup_termux.sh` and `setup_windows.ps1` are now hand-overs: they
find a Python 3.10+, say which one, and run `nerveforge install` with your
arguments. `run.py` still starts the bridge and `./nerveforge` is the new name
for it, so a shortcut or a README from an earlier version does not break. The
Windows script lost its own `winget` logic and its four switches: flags belong
in `nerveforge install`, where every platform gets them.

### Tests

`InstallerTests` used to read `setup_windows.ps1` and assert on its BOM, its
`chr(46)` trick and its brace balance — tests of a script, not of an installer.
They are replaced by 71 tests that run the real steps against a temporary
`HOME`: an old Python fails with the reason, a relative workspace is refused, a
declined download is a skip rather than a crash, running twice creates one
shortcut, `--plan` creates nothing, and `--uninstall` keeps the token.

Two Windows bugs came out of writing them that way. The `.cmd` wrapper did not
pass on `%ERRORLEVEL%`, so a launcher whose Python had gone missing would flash a
console and report success; it now holds the window open on a failure and exits
with the code. And the read-only-directory tests assumed `os.geteuid`, which
Windows does not have: they now skip on a platform without POSIX permission bits
and are joined by a test that refuses an unguarded `os.geteuid` anywhere in the
installer.

## 8.6.0

Skills stop being only the twelve that ship here. The Skills screen has a search
Expand Down
75 changes: 43 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NerveForge 8.6.0 ⚡ Arena.ai ↔ PC & Android Bridge
# NerveForge 8.7.0 ⚡ Arena.ai ↔ PC & Android Bridge

![NerveForge — Build boldly. Ship cleverly.](assets/nerveforge-lockup.png)

Expand Down Expand Up @@ -59,44 +59,52 @@ edit files, build projects and run arbitrary toolchains.

## 🚀 Quick start

### Step 1 — start the receiver
### Step 1 — install and start

Pick your platform:
One command, every platform. The installer is a Python program, so it asks the
same questions and prints the same report on Linux, macOS, Windows and Termux:

```bash
# Linux (Ubuntu / Mint / Debian)
git clone https://github.com/foursecondfivefour/NerveForge.git
cd NerveForge
bash setup.sh
./nerveforge install # asks a few questions, then starts the bridge
```

```powershell
# Windows 10 / 11 (PowerShell)
git clone https://github.com/foursecondfivefour/NerveForge.git
cd NerveForge
Set-ExecutionPolicy -Scope Process Bypass
.\setup_windows.ps1
On Windows use `.\nerveforge install` (or `python nerveforge install`). If the
file is not executable: `python3 nerveforge install`.

# Optional switches
.\setup_windows.ps1 -InstallTunnel # offer cloudflared/Tailscale via winget
.\setup_windows.ps1 -TunnelMode cloudflared # auto (default), cloudflared, tailscale, none
.\setup_windows.ps1 -NoStart # prepare only, do not run
```

The installer checks Python, picks a tunnel, asks for the working folder and
runs. Every step says what it found or why it stopped; nothing is installed
without an explicit `Y`. The token and the full-access passphrase are printed in
the startup banner. If the panel says **unauthorized**, the token is missing —
copy it from the banner or paste it on the Settings screen.
It checks Python, asks which tunnel to use, offers to download `cloudflared`,
asks which folder the agent may work in, and then starts the receiver. Every
step prints what it found or why it stopped, and nothing that changes the
machine happens without a `Y` from you.

```bash
# Android (Termux)
git clone https://github.com/foursecondfivefour/NerveForge.git
cd NerveForge
bash setup_termux.sh
./nerveforge install --plan # what it would change, and then stop
./nerveforge install --yes # take the defaults, no questions
./nerveforge install --tunnel none # local only, no public address
./nerveforge install --json --plan # the same plan, for another program
```

Or on any OS with Python 3.10+: `python3 run.py`.
| Question | Default |
|---|---|
| Tunnel | `auto`: `cloudflared` if present, else Tailscale, else local |
| Download `cloudflared` into the data folder | ask, never silently |
| Working folder for the agent | `~/Projects` |
| Desktop shortcut / menu entry | yes on a desktop, skipped on a server or Termux |
| `nerveforge` command on `PATH` | no — offered, never assumed |
| Start the bridge afterwards | yes |

The old entry points still work and now hand over to the same installer, so an
older README or a shortcut you keep will not break: `bash setup.sh`,
`bash setup_termux.sh`, `.\setup_windows.ps1`, `python3 run.py`.

To remove what the installer wrote — shortcut, launcher, downloaded
`cloudflared` — run `./nerveforge uninstall`. Your token, settings, skills and
audit log are kept: those are yours, not the installer's.

The token and the full-access passphrase are printed in the startup banner. If
the panel says **unauthorized**, the token is missing — copy it from the banner
or paste it on the Settings screen.

### No cloudflared? Let the panel fetch it

Expand Down Expand Up @@ -249,14 +257,14 @@ Full allowlist: `GET /api/quick` → `capabilities.public_upload.extensions`; ad

## 🧪 Tests and code quality

The repository ships **1834 automated unit tests** (Linux, Windows, Android/Termux, API, security,
The repository ships **1901 automated unit tests** (Linux, Windows, Android/Termux, API, security,
tunnels). CI runs them on Linux and Windows:

```bash
python3 -m unittest discover -s tests -v # 1834 tests
python3 -m unittest discover -s tests -v # 1901 tests
python3 -m compileall -q src tests run.py # Python bytecode
find static -name '*.js' -print0 | xargs -0 -n1 node --check # JavaScript syntax # JS syntax
bash -n setup.sh && bash -n setup_termux.sh # shell installers
bash -n setup.sh && bash -n setup_termux.sh # hand-over scripts
python3 scripts/gen_api_doc.py --check # docs/API.md is current
python3 scripts/bump_version.py --check # version artifacts agree
```
Expand Down Expand Up @@ -312,14 +320,17 @@ nerveforge/
│ ├── paths.py # Per-user data and config locations
│ ├── platform_support.py # OS detection and shell registry
│ ├── toolkit/ # Skills, tool catalogue and installer, MCP client and server
│ ├── installer/ # `nerveforge install`: the ten steps, the menu, the report
│ ├── tunnel/ # CLIs, manager and providers (cloudflared/tailscale)
│ ├── uzhas_manager.py # Shell runner with timeout and tree cancellation
│ └── workspace_manager.py # File operations, bwrap sandbox, public uploads
├── static/ # Web panel assets (HTML, CSS, JS)
├── tests/ # Unit tests (1834 tests)
├── tests/ # Unit tests (1901 tests)
├── pyproject.toml # PEP 517/518 build metadata
├── run.py # Run in place
├── nerveforge # ./nerveforge — start, or `install` step by step
├── run.py # Alias for ./nerveforge (old shortcuts keep working)
├── setup.sh / setup_windows.ps1 / setup_termux.sh
│ # Hand-over scripts: find Python, run `nerveforge install`
├── AGENTS.md # Agent manual
├── CHANGELOG.md # Release history
├── SECURITY.md # Security policy
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Security policy — NerveForge 8.6.0
# Security policy — NerveForge 8.7.0

**English** · [Русский](docs/ru/SECURITY.md)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.0
8.7.0
6 changes: 4 additions & 2 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

- Python 3.10 or newer; the application code uses the Python standard library.
- Node.js is needed only for the JavaScript syntax check.
- On Windows, PowerShell parses `setup_windows.ps1`; CI performs this check on a Windows runner.
- The installer is Python, so the same steps run on every system; the shell scripts only
find an interpreter and hand over to `./nerveforge install`.
- Linux sandbox tests use mocks in CI. To validate real Linux command isolation, test on a supported Mint/Ubuntu host with Bubblewrap and `prlimit` installed.

## Local checks
Expand All @@ -17,7 +18,8 @@ Run from the repository root:
python3 -m unittest discover -s tests -v
python3 -m compileall -q src tests run.py
find static -name '*.js' -print0 | xargs -0 -n1 node --check
bash -n setup.sh
bash -n setup.sh && bash -n setup_termux.sh
python3 nerveforge install --plan # the installer still runs
python3 scripts/gen_api_doc.py --check # docs/API.md is current
python3 scripts/bump_version.py --check # every artifact carries one version
python3 scripts/check_docs.py # EN/RU stay in step
Expand Down
65 changes: 65 additions & 0 deletions docs/ru/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,73 @@

[English](../../CHANGELOG.md) · **Русский**

## 8.7.0

Установщик перестаёт быть тремя shell-скриптами, у каждого из которых были свои
ответы, и становится одной программой на Python с одинаковыми шагами везде. Это
меньшее изменение, чем звучит, и более полезное, чем выглядит: старые скрипты не
были неправильными — они были разными. `setup.sh` знал про APT, `setup_termux.sh`
— про `pkg`, `setup_windows.ps1` — про `winget`, и у каждого было своё
представление о том, что говорить при отсутствии Python или туннеля.

### Одна программа, десять шагов, одно место, где чинить шаг

`./nerveforge install` проходит одни и те же десять шагов на Linux, macOS,
Windows и Termux: версия Python, права администратора, выбор туннеля, загрузка
туннеля, папки конфигурации и данных, рабочая папка, ярлык, команда
`nerveforge`, проверка программы и запуск. Каждый шаг печатает одну строку о
том, что найдено — путь, версию, причину — и запуск останавливается на первом
шаге, который не может продолжить, с подсказкой строкой ниже. Шаг, который
завершился ошибкой, но ничего не блокирует (заблокированная загрузка
`cloudflared` на машине, которая прекрасно работает локально), говорит об этом и
даёт остальным шагам продолжиться.

Десять шагов живут в `installer/actions.py`, вопросы — в `menu.py`, вывод — в
`render.py`. Новый шаг — это функция и строка в одном кортеже; второго скрипта,
который надо приводить в соответствие, нет.

### Три обещания, которые держат ключи

- **`--plan` ничего не меняет.** Он идёт по той же таблице шагов и печатает
только те, что изменили бы машину, поэтому план не может разойтись с запуском.
- **`--yes` отвечает значениями по умолчанию, и умолчания тихие.** Ярлык по
умолчанию — да на десктопе и пропускается на сервере и в Termux; команда
`nerveforge` по умолчанию — *нет*: её предлагают, а не навязывают. На машине
без графики `--yes` не ставит ничего, кроме папок, нужных мосту.
- **`--uninstall` проводит черту по содержимому самого оператора.** Он убирает
ярлык, лаунчер и скачанный `cloudflared`. Токен, настройки, установленные
скиллы и журнал аудита остаются — и установщик говорит, что оставил их.
Удаление токена при удалении было бы потерей данных в костюме установщика.

### Скрипты, которые у вас есть, продолжают работать

`setup.sh`, `setup_termux.sh` и `setup_windows.ps1` теперь только передают
управление: находят Python 3.10+, говорят, какой именно, и запускают
`nerveforge install` с вашими аргументами. `run.py` по-прежнему запускает мост, а
`./nerveforge` — его новое имя, так что ярлык или README прошлой версии ничего не
сломают. Windows-скрипт лишился своей логики `winget` и четырёх ключей: ключи
место в `nerveforge install`, где их получает каждая платформа.

### Тесты

`InstallerTests` читали `setup_windows.ps1` и проверяли его BOM, трюк с
`chr(46)` и баланс скобок — тесты скрипта, а не установщика. Их заменили 71
тест, которые прогоняют настоящие шаги на временном `HOME`: старый Python
падает с причиной, относительная рабочая папка отвергается, отклонённая загрузка
— это пропуск, а не падение, двойной запуск создаёт один ярлык, `--plan` не
создаёт ничего, а `--uninstall` сохраняет токен.

Два бага Windows всплыли именно из такого способа писать тесты. Обёртка `.cmd`
не передавала `%ERRORLEVEL%`, поэтому лаунчер, у которого пропал Python, мигал
консолью и сообщал об успехе; теперь окно остаётся открытым при ошибке, а код
возврата передаётся. А тесты на папку только для чтения опирались на
`os.geteuid`, которого в Windows нет: теперь они пропускаются на платформе без
POSIX-битов прав, и рядом появился тест, который не пропускает непроверенный
`os.geteuid` нигде в установщике.

## 8.6.0


Скиллы перестают быть только теми двенадцатью, что идут в комплекте. На экране
«Навыки» появился поиск по GitHub, ранжирование найденного и установка
выбранного — а объяснять стоит именно ранжирование, потому что интересное в
Expand Down
6 changes: 4 additions & 2 deletions docs/ru/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

- Python 3.10 или новее; приложение использует только стандартную библиотеку.
- Node.js нужен только для проверки синтаксиса JavaScript.
- На Windows `setup_windows.ps1` разбирает PowerShell; CI выполняет эту проверку на раннере Windows.
- Установщик написан на Python, поэтому одни и те же шаги выполняются на любой системе;
shell-скрипты лишь находят интерпретатор и передают управление `./nerveforge install`.
- Тесты песочницы Linux в CI построены на моках. Для проверки реальной изоляции нужен хост Mint/Ubuntu с установленными Bubblewrap и `prlimit`.

## Локальные проверки
Expand All @@ -17,7 +18,8 @@
python3 -m unittest discover -s tests -v
python3 -m compileall -q src tests run.py
find static -name '*.js' -print0 | xargs -0 -n1 node --check
bash -n setup.sh
bash -n setup.sh && bash -n setup_termux.sh
python3 nerveforge install --plan # установщик по-прежнему запускается
python3 scripts/gen_api_doc.py --check # docs/API.md актуален
python3 scripts/bump_version.py --check # версия одна на все артефакты
python3 scripts/check_docs.py # EN/RU не разъехались
Expand Down
Loading
Loading