feat(update): integrate managed installs and recoverable in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback. Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers. This code integration does not publish packages, enable signing or advance the public update channel. Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
This commit is contained in:
1 parent
76da55994b
commit
fbb61a373f
216 files changed
+27948
-1084
No files matched your search
@@ -58,6 +58,7 @@ For shorter, outcome-focused walkthroughs, browse the [task guide index](./guide
|
||||
| Need | Read |
|
||||
|---|---|
|
||||
| Commands and flags | [CLI Reference](./cli-reference.md) |
|
||||
| Update an installation or recover an interrupted update | [Updating nanobot](./updating.md) |
|
||||
| In-chat slash commands | [In-Chat Commands](./chat-commands.md) |
|
||||
| Config, workspace, gateway, sessions, tools, and memory in plain language | [Concepts](./concepts.md) |
|
||||
| Provider/model matching and selection | [Providers and Models](./providers.md) |
|
||||
@@ -90,5 +91,7 @@ These pages explain implementation and extension points. You do not need them to
|
||||
| Set up a development environment | [Development](./development.md) and [CONTRIBUTING.md](../CONTRIBUTING.md) |
|
||||
| Add a channel package | [Channel Package Guide](./channel-package-guide.md) |
|
||||
| Build the WebUI source | [WebUI Development](../webui/README.md) |
|
||||
| Change update APIs, execution or recovery | [Update protocol](./update-protocol.md) |
|
||||
| Prepare and publish a release | [Release checklist](./releasing.md) |
|
||||
|
||||
If a command or screen no longer matches these docs, please [open an issue](https://github.com/HKUDS/nanobot/issues) with your nanobot version, operating system, and the page that needs correction.
|
||||
+26
-2
@@ -7,6 +7,7 @@ Use this page when you know what you want to run and need the command shape. For
|
||||
| Goal | Command | Notes |
|
||||
|---|---|---|
|
||||
| Check the install | `nanobot --version` | If this fails, try `python -m nanobot --version` |
|
||||
| Update an ordinary Python venv | `nanobot update` | Latest stable PyPI release; use the [installation-specific route](./updating.md#installation-owners) for other methods |
|
||||
| Create or refresh config | `nanobot onboard` | Creates `~/.nanobot/config.json` and `~/.nanobot/workspace/` |
|
||||
| Refresh config non-interactively | `nanobot onboard --refresh` | Preserves existing values and adds missing default fields without prompting |
|
||||
| Use guided setup | `nanobot onboard --wizard` | Best when you prefer prompts over hand-editing JSON |
|
||||
@@ -52,6 +53,27 @@ Desktop-only distributions use the narrow `nanobot-desktop-tui` entrypoint insid
|
||||
|
||||
## Common Patterns
|
||||
|
||||
### Updating
|
||||
|
||||
```bash
|
||||
nanobot update --check # Check the latest stable PyPI release; do not install
|
||||
nanobot update # Install it in an ordinary Python venv
|
||||
nanobot update --dev # Update source and prepare its matching interfaces
|
||||
nanobot update --plan # Save an exact review; do not install or restart
|
||||
```
|
||||
|
||||
The first two commands target stable PyPI releases, not the saved Preview subscription. `--dev` (`--update-dev`) selects source, not Preview. `--plan --channel stable` or `--plan --channel preview` inspects that channel without changing the subscription; `--channel` requires `--plan`. Saved plans are not executed by `nanobot update`.
|
||||
|
||||
Before an in-place update, back up configuration, workspace files and chat history, then stop all processes sharing that Python environment. New versions may migrate stored data. Use the original [installation-specific route](./updating.md#installation-owners) for uv, pipx, containers, system packages and Desktop; do not overwrite a manager-owned environment with pip. Already-satisfying dependencies remain installed.
|
||||
|
||||
Source updates require Git. Existing editable checkouts fast-forward their current branch to its upstream; resolve local changes, detached HEADs and divergence manually. Updating a package with `--dev` creates an editable checkout under `~/.nanobot/src/` on the official `main` branch. nanobot downloads its pinned Bun when needed; Node is not required. To return to a release, install it in a separate environment and launch outside the checkout; in-place source-to-release switching is refused.
|
||||
|
||||
After installation, restart nanobot and verify the **running** gateway's version and behavior. The CLI checks the installation, not the live process. Downgrading requires `--allow-downgrade` and compatible data; back up before using it.
|
||||
|
||||
In-place CLI updates have no automatic rollback. A failed or interrupted installation leaves an incomplete-update marker under `~/.nanobot/run/`. Stop nanobot and retry the same update from that environment. On Windows, stop processes holding installation files and retry with that environment's `python -m nanobot update` (add `--dev` for source).
|
||||
|
||||
The WebUI's **Settings → About** uses a separate reviewed update-and-restart flow for supported installations and shows owner-specific instructions for others. See [Updating nanobot](./updating.md) for Preview selection, recovery and permission limits. Source updates remain CLI-only. To inspect a saved WebUI job, use `nanobot update --job <plan-id>`; [explicit handoff retry](./updating.md#explicit-recovery-before-package-mutation) requires additional consent and an intact installation, not a post-install repair.
|
||||
|
||||
Most day-to-day commands use the default config and workspace. Advanced or multi-instance runs usually pass both paths explicitly:
|
||||
|
||||
```bash
|
||||
@@ -141,17 +163,19 @@ Interactive mode exits with `exit`, `quit`, `/exit`, `/quit`, `:q`, or `Ctrl+D`.
|
||||
|
||||
| Command | Description |
|
||||
|---|---|
|
||||
| `nanobot webui` | Create config/workspace if needed, enable the local WebUI channel after confirmation, start the gateway, open `http://127.0.0.1:8765`, and follow new gateway logs |
|
||||
| `nanobot webui` | Prepare local WebUI settings and open the browser; installer-managed environments launch persistently, other installations remain attached and follow gateway logs |
|
||||
| `nanobot webui --detach` | Explicitly start or join a persistent gateway, open the browser and return control to the terminal |
|
||||
| `nanobot webui --background` | Deprecated; prints the equivalent explicit `nanobot gateway --background` command and exits |
|
||||
| `nanobot webui --dev` | Start the gateway and Vite together at `http://127.0.0.1:5173`, with live frontend updates |
|
||||
| `nanobot webui --no-open` | Prepare and start the WebUI without opening a browser |
|
||||
| `nanobot webui --no-dock` | Suppress the macOS Dock icon; detached mode remembers this choice until the next WebUI launch |
|
||||
| `nanobot webui --port <port>` | Set the WebUI/WebSocket port |
|
||||
| `nanobot webui --gateway-port <port>` | Override the gateway health port |
|
||||
| `nanobot webui --yes` | Apply safe localhost WebUI defaults without confirmation; configure provider credentials in **Settings → Models** |
|
||||
|
||||
First-run WebUI setup binds to `127.0.0.1` by default. Use manual configuration and a WebUI password before exposing the WebSocket channel beyond localhost.
|
||||
|
||||
`--dev` is a foreground source-checkout workflow. For shell-based lifecycle management, use `nanobot gateway --background` (or `/detach` from an interactive TUI); `nanobot webui --background` prints migration guidance instead of silently changing process ownership. It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops only when no other interactive client still holds it.
|
||||
`--dev` is a foreground source-checkout workflow and cannot be combined with `--detach`. It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops only when no other interactive client still holds it. Installer-managed normal WebUI launches and explicit `--detach` use the gateway's persistent lifecycle; manage that same instance with the `gateway` commands below. The old `webui --background` spelling remains deprecated and prints migration guidance.
|
||||
|
||||
## Gateway
|
||||
|
||||
|
||||
+23
-27
@@ -12,7 +12,7 @@ These repository docs describe `main`, which can be newer than the released pack
|
||||
- Access to one supported AI provider, company endpoint, or local model server.
|
||||
- The credential, endpoint URL, and model ID required by that service. Local providers such as Ollama may not require a key.
|
||||
|
||||
Git and [Bun](https://bun.sh/) are only needed if you want to install from editable source code. The published installer supports macOS 13+ (Apple Silicon and Intel), Linux with glibc 2.17+ (ARM64 and x64), and Windows x64. On other platforms, use the WebUI or `nanobot --classic`. See the [terminal requirements](./cli-reference.md#agent-cli) for native TUI availability and the [release notes](https://nanobot.wiki/docs/latest/getting-started/quick-start) for package details.
|
||||
Official platform packages include the WebUI and matching native TUI for macOS 13+ (Apple Silicon and Intel), glibc 2.17+ Linux (ARM64 and x64), and Windows x64; no frontend build tools are needed. Other platforms can use the WebUI or `nanobot --classic`; see [terminal requirements](./cli-reference.md#agent-cli). Source installs need Git and use Bun, which nanobot downloads when needed.
|
||||
|
||||
## 1. Install nanobot
|
||||
|
||||
@@ -30,13 +30,13 @@ curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.
|
||||
irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1 | iex
|
||||
```
|
||||
|
||||
The installer chooses an active virtual environment, `uv`, `pipx`, or a managed environment under `~/.nanobot/venv`. It installs the stable PyPI release. At the end it prints the exact command it used to run nanobot; if `nanobot` is not on `PATH`, reuse that full command in the examples below.
|
||||
A fresh install uses a dedicated environment under `~/.nanobot/venv`, even if uv or pipx is on PATH. Existing installations keep their original manager; an active ordinary virtual environment remains an explicit target and is not adopted. The installer installs the stable PyPI release and prints the exact command it used to run nanobot. If `nanobot` is not on `PATH`, reuse that full command below.
|
||||
|
||||
If you prefer to inspect the scripts first, open [`install.sh`](../scripts/install.sh) or [`install.ps1`](../scripts/install.ps1).
|
||||
|
||||
## 2. Configure Your Model
|
||||
|
||||
Keep the installer terminal open. The browser opens the local WebUI; go to **Settings → Models** and:
|
||||
Wait for installation and startup to finish. The browser opens the local WebUI; go to **Settings → Models** and:
|
||||
|
||||
1. Choose **New preset** and give it a name. If **Convert to presets** appears, choose it first.
|
||||
2. Open **Provider** and select your provider. To add one, choose **Add provider** from the same menu, then enter and save its connection details or complete sign-in.
|
||||
@@ -79,7 +79,7 @@ Most other providers can say `not set`. This command validates local setup but d
|
||||
|
||||
## 4. Get the First Reply
|
||||
|
||||
If the installer-started WebUI is no longer running, run `nanobot webui` again. Leave that launcher open; the first-run WebUI is bound to localhost, so other devices on your network cannot reach it.
|
||||
If the installer-started WebUI is no longer running, run `nanobot webui` again. The first-run WebUI is bound to localhost, so other devices on your network cannot reach it.
|
||||
|
||||
Send:
|
||||
|
||||
@@ -89,7 +89,9 @@ Hello!
|
||||
|
||||
Any normal assistant answer is success. It proves that nanobot can load the config, reach the selected model, use the workspace, and serve the browser UI.
|
||||
|
||||
Interactive WebUI and TUI launchers share one on-demand gateway. Closing one launcher leaves it running for the others; closing the last launcher stops it. If you prefer a persistent background process, press `Ctrl+C`, then run:
|
||||
Fresh official-installer environments start a persistent gateway: closing the browser or terminal does not stop it. Other installations keep their on-demand lifetime unless you explicitly use `nanobot webui --detach` or the gateway command below. An attached on-demand launcher must stay open; closing its last local client stops that gateway.
|
||||
|
||||
To start or inspect a persistent gateway:
|
||||
|
||||
```bash
|
||||
nanobot gateway --background
|
||||
@@ -163,7 +165,7 @@ If pip reports `externally-managed-environment`, use the recommended installer,
|
||||
|
||||
**Current source**
|
||||
|
||||
Clone the repository and install it in editable mode. Bun is required so the checkout can run its matching native TUI instead of mixing current Python with an older release binary.
|
||||
Clone the repository and install it in editable mode. nanobot downloads the pinned Bun runtime to run the checkout's matching TUI; Node is not required.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HKUDS/nanobot.git
|
||||
@@ -180,15 +182,19 @@ nanobot webui
|
||||
|
||||
The source path follows current `main` and can be newer than the published package. The editable install keeps Python pointed at the checkout; `nanobot` runs `tui/` with Bun, and `nanobot webui` automatically rebuilds `webui/` when its bundled assets are stale. All normal commands remain the same as a stable install. For development details, follow [`../CONTRIBUTING.md`](../CONTRIBUTING.md).
|
||||
|
||||
If the package is installed but the shell cannot find `nanobot`, use the runner that owns the installation. The recommended installer prints the exact command to reuse. Common forms are:
|
||||
If the shell cannot find `nanobot`, reuse the installer's printed command or run Python from the existing installation. For uv or pipx, locate that environment with the original manager; do not start a temporary tool environment to manage it. The official installer's default paths are:
|
||||
|
||||
```bash
|
||||
uv tool run --from nanobot-ai nanobot --version
|
||||
pipx run --spec nanobot-ai nanobot --version
|
||||
~/.nanobot/venv/bin/python -m nanobot --version
|
||||
~/.nanobot/venv/bin/python -I -m nanobot --version
|
||||
```
|
||||
|
||||
On Windows, the managed-environment form is `& "$HOME\.nanobot\venv\Scripts\python.exe" -m nanobot --version`. Replace `--version` with `webui`, `onboard --wizard`, or any other arguments you need. Use plain `python -m nanobot` only when that Python executable belongs to the environment where nanobot was installed.
|
||||
Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
& "$HOME\.nanobot\venv\Scripts\python.exe" -I -m nanobot --version
|
||||
```
|
||||
|
||||
Replace `--version` with `webui`, `onboard --wizard`, or the arguments you need. Use plain `python -m nanobot` only when that Python belongs to the installed environment.
|
||||
|
||||
## Manual Configuration Fallback
|
||||
|
||||
@@ -227,26 +233,16 @@ Replace the provider, endpoint, and model together. Do not pair a credential fro
|
||||
|
||||
## Updating
|
||||
|
||||
Upgrade with the same method you used to install:
|
||||
Open **Settings → About → Update**. Supported installations can update and restart there; others show instructions for their original package manager or deployment. Follow [Updating nanobot](./updating.md) for Preview selection, backups and recovery. Do not switch installation methods to work around an error.
|
||||
|
||||
For an ordinary Python virtual environment, the [CLI updater](./cli-reference.md#updating) is also available:
|
||||
|
||||
```bash
|
||||
# Recommended installer
|
||||
curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
|
||||
|
||||
# Or one of these
|
||||
uv tool upgrade nanobot-ai
|
||||
pipx upgrade nanobot-ai
|
||||
python -m pip install -U nanobot-ai
|
||||
nanobot update --check
|
||||
nanobot update
|
||||
```
|
||||
|
||||
For a source checkout:
|
||||
|
||||
```bash
|
||||
git pull --ff-only
|
||||
python -m pip install -e .
|
||||
```
|
||||
|
||||
Because the install is editable, normal source changes are visible immediately. Re-running the install synchronizes any changed Python dependencies; the TUI and WebUI refresh their own dependencies/assets when launched. Then check `nanobot --version`. Run `nanobot onboard --refresh` when you want to add newly introduced default fields while preserving existing settings.
|
||||
Stop affected processes and back up configuration and data first; restart and verify the running version afterward. Source checkouts should preserve local changes and follow the [development instructions](../CONTRIBUTING.md).
|
||||
|
||||
## If the First Reply Fails
|
||||
|
||||
|
||||
+220
-28
@@ -1,29 +1,74 @@
|
||||
# Release checklist
|
||||
|
||||
Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract). Preparing a release does not publish it. Pushing a Git tag, publishing a GitHub Release, uploading to PyPI, and deploying the documentation are separate operations.
|
||||
Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract). Preparation does not authorize publication. Pushing tags, publishing GitHub Releases, uploading to PyPI and deploying documentation are separate operations.
|
||||
|
||||
## Release cadence
|
||||
|
||||
Stable is the default feed; Preview is opt-in. Both use one update flow and require confirmation before installation. Neither a faster cadence nor a subscription permits stopping tasks or restarting a gateway automatically. See [Updating nanobot](./updating.md) for user instructions.
|
||||
|
||||
| Release | When to prepare it | Public destination | User experience |
|
||||
| --- | --- | --- | --- |
|
||||
| Stable feature release | At the planned feature milestone | Final GitHub Release and PyPI; also index its manifest for Preview subscribers | Normal update notice |
|
||||
| Stable patch | When a reviewed fix or small, compatible improvement is ready; do not wait for the next monthly milestone | Same stable destinations and checks | Normal update notice, no Preview opt-in required |
|
||||
| Preview | On maintainer request, from reviewed changes with passing checks; potentially daily | GitHub prerelease and protected `release-index` catalogue; not PyPI | Same update notice for subscribers, with risk shown before installation |
|
||||
|
||||
Packaging is maintainer-triggered, not scheduled or push-triggered. Record the requested channel, exact source and candidate identity; preparation does not authorize publication. Unchanged source, failed checks, missing assets, incomplete acceptance or absent approval leaves the last verified release in place. There is no daily-release promise. Acceptance must cover the supported stable baseline and an earlier Preview, including skipped previews, not just the previous build.
|
||||
|
||||
### Stable patch procedure
|
||||
|
||||
1. Select the supported stable baseline and reviewed fixes. If `main` contains unfinished features, branch from that baseline and backport only the required fixes. Do not relabel an unverified Preview as stable.
|
||||
2. Allocate an unused final version, update both version declarations, and follow **Prepare a candidate**. Patches require the same packaging, licensing, native startup, data-preservation and update/recovery gates as feature releases.
|
||||
3. Publish approved immutable files in order: GitHub, PyPI, public-download checks, then the catalogue's `stable` pointer. Preserve `preview` and withdrawal history. A stable patch older than an installed Preview must not be offered as a downgrade.
|
||||
4. Publish concise fix notes and required operator actions. Users without this updater need their original installation method for the first upgrade; external package/deployment owners retain their route.
|
||||
|
||||
### Maintainer-triggered Preview procedure
|
||||
|
||||
1. Select an exact reviewed `main` commit with passing required CI; skip it if its source SHA matches the last accepted candidate. Record the next unreleased stable base and an unused increasing Preview sequence.
|
||||
2. Run **Verify Release Candidate** for that ref and base. It prepares a version-only candidate, builds the WebUI and five native TUI bundles, and verifies the package set without publication. Users receive built packages, not a checkout requiring Bun.
|
||||
3. Select `retain_installable` and preserve the handoff before expiry. Complete native and packaged old-to-new update/recovery acceptance against those exact bytes. Keep candidate SHA, manifest hash, coverage, known issues and source-offer approval together; CI reports alone are neither installable artifacts nor publication consent.
|
||||
4. With separate approval, publish immutable `v<version>` at the **candidate** commit and a GitHub prerelease, never the latest stable release. Upload the complete verified set, manifest and notes; make the pinned installer source publicly reachable.
|
||||
5. Verify all public sizes/hashes and clean public install/update acceptance before advancing `preview` with a new catalogue generation. Validate against the latest catalogue, preserve `stable` and withdrawals, and serialize stable, Preview and withdrawal writes. A stale publisher must reread and revalidate.
|
||||
6. After partial upload, leave the feed unchanged and resume only from the original verified files. Lost or changed bytes require a new version and repeated acceptance. Withdraw unsafe candidates with a reason and offer a newer fix; never rewind the feed or restore user data.
|
||||
|
||||
Use Python version ordering: `0.3.6.dev42 < 0.3.6.dev43 < 0.3.6 < 0.3.7.dev1` (illustrative versions). Once a final base ships, previews need a later base; allocate it after accounting for stable patches. The workflow uses `github.run_number` for `N` in `X.Y.Z.devN`; do not reset the sequence without checking published versions. Reruns cannot replace published bytes. Rebuild and test final releases under their final identity; never rename `.devN` wheels.
|
||||
|
||||
### Launch gates and automation boundary
|
||||
|
||||
Before offering public Preview, obtain approval for index ownership/protection, publication credentials, source retention and exact packaged/public-download acceptance. Candidate preparation does not activate a public channel, schedule, protected publisher or PyPI upload. Preserve approved release bytes and source outside expiring CI storage for their required lifetime.
|
||||
|
||||
Automate steps within an explicitly requested run, not the decision to build or publish. Keep builds read-only, publication permissions in a protected stage, the last accepted source/version recorded and one serialized catalogue writer. Announce Preview availability only after verifying its public feed. Any discovery hint must be dismissible; do not show an update badge for an unavailable channel or enroll users merely because they check.
|
||||
|
||||
## Prepare a candidate
|
||||
|
||||
1. Choose the previous release and the exact candidate commit. Work in a clean worktree; do not include local configuration, session data, credentials, or unrelated changes.
|
||||
2. Update `project.version` in `pyproject.toml` and the final source-only fallback in `nanobot/__init__.py`. Private WebUI/TUI package versions are not the Python release version.
|
||||
3. Review the changes since the previous tag. Write highlights, upgrade and rollback guidance, contributor acknowledgements, and the full changelog. Verify counts against the final range; commit counts are not merged-PR counts. Coordinate security disclosures separately.
|
||||
4. Run the Python, WebUI, and TUI checks from CI. Confirm the final commit's CI status, not just an earlier PR head. Review installation, configuration, session, and API changes.
|
||||
5. Build in a clean output directory with `uv build --out-dir <artifact-directory>`. Do not set `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles the WebUI in the sdist and wheel; the wheel is built from the sdist.
|
||||
6. Check the intermediate distributions with `twine check`, inspect their contents, and record SHA-256 hashes. Test installation in an isolated environment outside the source checkout, then test upgrading from the previous stable version using disposable configuration and sessions. Do not use a maintainer's live workspace for migration tests.
|
||||
7. Prepare the matching documentation PR in `Re-bin/nanobot-web`, following its `MAINTAINING.md`. Review English and all nine translations, preserve Nightly and previous releases, update the latest-version redirects, and run the complete site quality gate. Pin source links to the checked candidate commit; confirm those source files match the eventual tag before deploying. Never advertise an unpublished version as publicly available.
|
||||
8. Review the pinned Bun/OpenTUI licenses, corresponding-source materials, and relinking instructions now, not after pushing the tag. Verify the exact upstream revisions are retrievable and the runtime versions match the lockfile and notices. Obtain the maintainer's commitment to honor `tui/SOURCE_OFFER.md` for its entire stated period; tests cannot grant it.
|
||||
9. Build all five native TUI targets using the same scripts as the publication workflow. Include ad-hoc signatures for macOS before packaging. Verify every archive's checksum, manifest, executable architecture, required notices/licenses, and embedded source contents. Run platform-specific smoke tests where supported; record cross-compiled-only targets as such and link exact-head CI evidence instead of claiming native execution everywhere. Bundle these archives into the five platform wheels using the command below. Check all final wheels with `twine check`, validate their RECORDs, tags and installed executable permissions, and test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`. The installed executable must come from `site-packages/nanobot/tui/bin/`, not the checkout or a cache.
|
||||
10. Merge the release-preparation PR only after its current checks and reviews pass. Confirm the merged source tree matches the tested candidate; if it does not, rebuild and recheck before tagging. Reconcile the final changelog and documentation source references. The tag must point to this verified commit, not an unchecked later `main` tip.
|
||||
1. Choose the previous release and exact candidate commit. Use a clean worktree without local configuration, sessions, credentials or unrelated changes.
|
||||
2. Update `project.version` in `pyproject.toml` and the final source-only fallback in `nanobot/__init__.py`. Private WebUI/TUI versions are not the Python release version.
|
||||
3. Review the final tag range; prepare highlights, upgrade/rollback guidance, acknowledgements and full changelog. Verify counts: commits are not merged PRs. Coordinate security disclosures separately.
|
||||
4. Run Python, WebUI and TUI CI checks against the final commit, not an earlier PR head. Review installation, configuration, session and API changes.
|
||||
5. Run `uv build --out-dir <artifact-directory>` in a clean output directory without `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles WebUI in sdist and wheel; the wheel is built from the sdist.
|
||||
6. Run `twine check` on intermediates, inspect contents and record SHA-256 hashes. Test installation in an isolated environment outside the checkout and upgrade from previous stable with disposable configuration/sessions, never a maintainer's live workspace.
|
||||
7. Prepare the documentation PR in `Re-bin/nanobot-web` under its `MAINTAINING.md`: review English and all nine translations, preserve Nightly and previous releases, update latest-version redirects and run the full site quality gate. Pin source links to the candidate and confirm they match the eventual tag. Do not advertise an unpublished version.
|
||||
8. Review pinned Bun/OpenTUI licenses, corresponding source and relinking instructions. Check upstream revision availability and runtime/lockfile/notice agreement. Obtain the maintainer's commitment to the [source offer](../tui/SOURCE_OFFER.md) for its full stated period, at least three years after release; tests cannot grant it.
|
||||
9. Build all five native targets with publication scripts, ad-hoc signing macOS before packaging.
|
||||
- Verify archive checksums, manifests, architecture, licenses/notices and embedded source. Run supported native smoke tests, record coverage and exact-head CI evidence, and label cross-compiled-only targets.
|
||||
- Build platform wheels below, check them with `twine check`, validate RECORDs/tags/permissions and test pip selection on all five platforms.
|
||||
- Test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`; the executable must come from `site-packages/nanobot/tui/bin/`, not checkout or cache.
|
||||
10. Merge release preparation only after current checks/reviews pass. Compare the merged source tree with the tested candidate; rebuild/recheck changes. Reconcile changelog and documentation links, then tag the verified commit, not an unchecked later `main` tip.
|
||||
|
||||
### Protected updater handoff compatibility
|
||||
|
||||
Restart-capable packages include `nanobot/update_contract.json`: schema version 1, with `handoff_protocols` listing positive integer protocol IDs. Protocol 1's request, protected startup and activation requirements are defined in the [update protocol](./update-protocol.md), independently of package and WebUI versions.
|
||||
|
||||
Before advertising protocol 1, run preparation, frozen-worker and actual-gateway restart tests against packaged code; verify the declaration is in both sdist and wheel. Retain an ID only while its entire contract is supported; incompatible request, startup or activation behavior needs a new ID. Older updaters may install a future package only if protocols overlap. Missing, malformed or non-overlapping declarations must be refused before shutdown and require the installation owner's external update route.
|
||||
|
||||
### OpenAI API selector compatibility window
|
||||
|
||||
The temporary `providers.openai.apiType` / `api_type` conversion is supported for exactly two consecutive releases: the first release containing `nanobot/config/provider_api_migration.py` and the next release. Record the first release tag and the final supported tag in release notes. Config saves write the new `api` declaration; there is no legacy runtime selector.
|
||||
The temporary `providers.openai.apiType` / `api_type` conversion lasts exactly two consecutive releases: the first containing `nanobot/config/provider_api_migration.py` and the next. Record the first and final supported tags in release notes. Config saves write `api`; there is no legacy runtime selector.
|
||||
|
||||
Before publishing the third release, remove `provider_api_migration.py`, its import and `ProvidersConfig._migrate_legacy_api_type`, and the legacy settings query conversion in `nanobot/webui/settings_models.py`. Remove the migration-specific tests and update the configuration documentation and release notes to require the current format. Keep the current-format routing, settings, and persistence regressions.
|
||||
Before the third release, remove `provider_api_migration.py`, its import, `ProvidersConfig._migrate_legacy_api_type`, the legacy settings query conversion in `nanobot/webui/settings_models.py` and migration-specific tests. Update configuration docs and release notes to require the current format. Keep current-format routing, settings and persistence regressions.
|
||||
|
||||
### TUI preflight without a release tag
|
||||
|
||||
Use Bun 1.3.13 and a clean checkout. The local build and packaging scripts do not require a tag or GitHub Release. Run targets sequentially because native dependency preparation modifies the shared `node_modules` directory:
|
||||
Use Bun 1.3.13 and a clean checkout; no tag or GitHub Release is required. Run targets sequentially because native dependency preparation modifies shared `node_modules`:
|
||||
|
||||
```bash
|
||||
cd tui
|
||||
@@ -35,11 +80,11 @@ bun scripts/release-notices.ts <target>
|
||||
python3 scripts/package-release.py <target>
|
||||
```
|
||||
|
||||
Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`. On macOS, use `codesign --force --sign - <binary>` and verify the signature. The publication workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` outputs in a candidate-specific directory, alongside the Python build intermediates and provenance manifest. Do not include local configuration, instance backups, or test environments in upload selections.
|
||||
Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64` and `win32-x64`. On macOS, run `codesign --force --sign - <binary>` and verify it; the publication workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` files with Python intermediates and provenance manifest in a candidate-specific directory, excluding configuration, backups and test environments from upload selections.
|
||||
|
||||
### Build the PyPI platform wheels
|
||||
|
||||
From the exact release checkout, after `uv build` and the native archive checks:
|
||||
After `uv build` and native archive checks, from the exact release checkout:
|
||||
|
||||
```bash
|
||||
uv run python -m scripts.build_tui_wheels \
|
||||
@@ -48,23 +93,170 @@ uv run python -m scripts.build_tui_wheels \
|
||||
--out-dir <final-wheels>
|
||||
```
|
||||
|
||||
The script verifies the Python version and RECORD, native checksums, architecture, notices and embedded source against the checkout, then writes five wheels with complete TUI bundles and regenerated RECORDs. It refuses to overwrite an existing candidate. `--target <target>` builds one platform for a targeted check. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows x64; x64 builds use Bun's baseline (SSE4.2) runtime instead of requiring AVX2. Recheck both Bun and OpenTUI when upgrading either dependency. No musl or Windows ARM64 wheel is provided. Native execution checks must still validate the actual binaries; tags alone do not prove compatibility. Test pip selection for all five supported platforms.
|
||||
The script checks Python version/RECORD and native checksums, architecture, notices and source against the checkout, then writes five bundled wheels with regenerated RECORDs. It refuses existing candidates; `--target <target>` selects one platform. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows x64; x64 uses Bun's baseline SSE4.2 runtime, not AVX2. Recheck Bun/OpenTUI requirements when upgrading either. There are no musl or Windows ARM64 wheels; tags do not substitute for native execution.
|
||||
|
||||
The final PyPI upload set is **five platform wheels plus one source distribution**. Do not upload the intermediate `py3-none-any.whl` or native ZIPs to PyPI. Keep the source distribution produced by the same build; it remains usable for Python/classic and WebUI installations on other platforms.
|
||||
PyPI receives **five platform wheels and one sdist**, not the intermediate universal wheel or native ZIPs. Keep the same build's platform-neutral sdist for Python/classic and WebUI on other platforms. Record source commit, version, files, hashes, checks and remaining gates; source changes require rebuilding and rechecking.
|
||||
|
||||
Keep an artifact manifest with the source commit, version, filenames, hashes, checks performed, and any remaining release gates. Rebuild and recheck if the packaged source changes.
|
||||
Final releases also require `release-manifest.json` for `stable`. Run `scripts.release_candidate assemble` as shown below from the clean final-version checkout, using that final commit as `--source-commit` without Preview preparation. GitHub receives the same wheels/sdist, ten archive/checksum files and manifest; PyPI receives only wheels/sdist. Verify final source and public bytes before catalogue advancement. A TUI-only GitHub Release cannot deliver the final release to Preview subscribers.
|
||||
|
||||
## Publish, with maintainer approval
|
||||
|
||||
1. Confirm all pre-tag gates above are complete. Create and push exactly `vX.Y.Z`; do not move or reuse a published version tag.
|
||||
2. Create the matching GitHub Release. A draft may be used while assembling its attachments. Pushing the tag alone does not run `Publish Terminal UI` or upload anything to PyPI.
|
||||
3. Attach the already verified five TUI archives and their `.sha256` files, after confirming the tag's packaged sources match the artifact manifest. Verify the uploaded bytes match their preflight hashes; never upload a naked executable.
|
||||
4. If instead rebuilding through **Publish Terminal UI**, use `tag=vX.Y.Z` and confirm the already completed compliance review. Wait for all five targets and repeat artifact checks on those new outputs. Do not substitute their new bytes under the old artifact hashes.
|
||||
5. Make the GitHub Release and all TUI attachments publicly available. Verify their public downloads for fallback/source-built installations. Supported platform-wheel installs do not need these downloads to start the TUI.
|
||||
6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and the five final platform wheels to PyPI. Do not upload the intermediate universal wheel or stale files from a shared `dist/` directory. This repository has no automatic PyPI publication workflow.
|
||||
7. Verify installation from PyPI, bundled WebUI startup, and bundled TUI startup without downloads in clean environments. Merge the prepared wiki PR only when the stable package is available: merging its `main` deploys the site automatically. Confirm all localized `/docs/latest/` routes select the new version and old version links still work.
|
||||
8. Publish the release announcement and add the dated entry to [Release Archive](./release-archive.md). Complete any coordinated advisory publication and reporter notification. Record links and completion status in the release tracking issue.
|
||||
### Release approval proof
|
||||
|
||||
Both Stable and Preview automatic installs require `release-manifest.json.sigstore.json` beside the manifest on the exact GitHub release. Clients verify Sigstore's production certificate chain/transparency proof and accept only `HKUDS/nanobot`'s manual `release-approve.yml` on `main`. The signed manifest must match version, wheel size/digest and, for Preview, catalogue commit/manifest binding. Verification runs before download and before shutdown, with no unsigned fallback. Unsigned historical releases remain discoverable but cannot be automatically installed; existing installations keep running.
|
||||
|
||||
Before setting the repository variable `NANOBOT_RELEASE_SIGNING_ENABLED=true`, an administrator must protect `main` and the `release-approval` environment: require independent review, prevent self-review, allow deployment only from `main`, and restrict bypass and changes to the workflow/signing requirements. Signing is disabled without that variable. No long-lived signing key or Apple Developer ID is required.
|
||||
|
||||
After candidate tests and dependency review, take version, manifest SHA-256, source SHA and candidate SHA from retained acceptance evidence, not public downloads. Upload the proposed manifest through the separately authorized release handoff, then manually run **Approve Exact Release** from `main` with those values and obtain environment review. The hash-locked job checks/signs the exact manifest without installing candidate code or writing releases, PyPI or the catalogue. Separately authorize attaching its proof, verify the public proof before advancing either channel, and preserve it with candidate evidence before its three-day CI expiry.
|
||||
|
||||
Regenerate the signing lock only in a reviewed dependency update:
|
||||
|
||||
```bash
|
||||
uv pip compile .github/release-signing-requirements.in --python-version 3.11 \
|
||||
--python-platform x86_64-manylinux_2_17 --generate-hashes --no-header \
|
||||
--output-file .github/release-signing-requirements.txt
|
||||
```
|
||||
|
||||
Review resolved dependencies; hashes are not malware review. Before the first release, prove a supported real old updater can install the signed candidate and that the candidate can install the next signed version. Private packaged recovery fixtures substitute publication authority and are not signature evidence.
|
||||
|
||||
The proof authenticates release approval, not reproducible builds or harmless code. Compromised authorized workflows/reviewers, malicious source that passes review and compromised runtime dependencies remain risks. The signing lock does not lock runtime resolution, which retains the installation owner's policy. A reviewed runtime dependency inventory, public signed upgrade continuity and verified repository protection settings remain security-release gates; do not claim comprehensive supply-chain protection without them. The first installer and checksum source also need a trusted distribution channel.
|
||||
|
||||
1. Complete pre-tag gates, then create and push exactly `vX.Y.Z`; never move or reuse a published tag.
|
||||
2. Create the matching GitHub Release. A tag push alone runs neither **Publish Terminal UI** nor PyPI publication.
|
||||
3. Attach five platform wheels, sdist, five TUI archives, their `.sha256` files and `release-manifest.json`. Confirm tag sources match the manifest and uploaded hashes match preflight. Complete approval proof before offering automatic updates; never upload a naked executable.
|
||||
4. If rebuilding via **Publish Terminal UI**, use `tag=vX.Y.Z` with compliance review confirmed. Wait for all five targets, recheck outputs, and assemble/recheck wheels and manifest from those exact archives. Never mix rebuilt archives with old wheel bytes/hashes; replacing public assets requires a new version.
|
||||
5. Make the release and complete artifact set public. Verify every file against the accepted manifest, including native fallback/source-install archives. Platform-wheel TUI startup must not need downloads.
|
||||
6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and five final wheels to PyPI, not the universal intermediate or stale shared `dist/` files. There is no automatic PyPI publication workflow.
|
||||
7. Verify clean PyPI installation, bundled WebUI and download-free TUI startup. After all public GitHub/PyPI files pass, advance `stable`, preserving Preview and withdrawals; check discovery for both subscriptions. Only then merge the wiki PR: its `main` deploys automatically. Confirm all localized `/docs/latest/` routes select the new version and old-version links still work.
|
||||
8. Announce the release, add its dated [Release Archive](./release-archive.md) entry, complete coordinated advisories/reporter notifications, and record links/status in the release tracking issue.
|
||||
|
||||
## If a gate fails
|
||||
|
||||
Do not publish to PyPI while a required TUI artifact or verification is missing. Keep the documentation's public `latest` on the previous stable version until the new version is usable. If a published package needs a correction, prepare a new version; do not silently replace the code behind an existing release tag. Stop all old processes and follow the documented session rollback procedure before downgrading a migrated installation.
|
||||
Do not publish to PyPI with missing TUI artifacts or verification. Keep public documentation's `latest` on the usable stable version. Correct published packages with a new version, never replacement code behind an existing tag. Before downgrading a migrated installation, stop all old processes and follow the documented session rollback procedure.
|
||||
|
||||
## Installer identity checks
|
||||
|
||||
Fresh base-package installs use the official installer's dedicated venv regardless of optional managers on PATH. `nanobot-install.json` is written before venv/download work so failed first installs retain their owner; it is not readiness proof. Existing venv/uv/pipx installations are not adopted or moved. The receipt records extras for update planning and opts `webui` into persistent background launch; unrecorded installs retain their lifecycle. Include this distinction and the instance-specific stop command in release notes.
|
||||
|
||||
Linux/Windows native CI builds a platform wheel and runs the public installer in a private home without Bun/Node/Git on PATH, then checks the managed receipt, installed WebUI, native TUI and gateway. Python/WebUI changes also require these jobs. CI retains small reports, not candidate binaries. Startup probes and offline installer fixtures do not replace packaged upgrade/recovery or public-download acceptance.
|
||||
|
||||
Run `pytest tests/test_install_scripts.py` with `uv` and `pipx` available. It uses private homes, offline fixture wheels and real managers, without a gateway or real application install: `install.sh` on Unix and Windows PowerShell with `install.ps1` on Windows. CI provisions pipx outside application dependencies. Verify these owner-preservation requirements:
|
||||
|
||||
- Launch the selected persistent environment's isolated Python, not `pipx run`, disposable tools or an arbitrary PATH executable. Existing recognized installations take priority over newly available managers; multiple recognized installs require explicit choice. An ordinary active venv is explicit; uv/pipx environments must use their manager.
|
||||
- Preserve uv constraints. Generic pipx upgrades can drop constraints/options; the installer must refuse pipx records with those settings, lock workflows or unconfirmed sources. The owner must review and preserve them. Exact wheels may replace a wheel source, not registry constraints/options; pipx upgrades must retain requested extras and refuse wheels missing recorded extras.
|
||||
- A failed selected manager must not fall through to another installation, even on first install. Verify the exact persistent package version before onboarding: a successful pinned/locked skip is not target installation. Restarted gateway identity is a separate check.
|
||||
|
||||
Verify the exact-handoff options against the pinned installer, not an older script: `install.sh --wheel <path> --sha256 <published-hash>` / `install.ps1 -Wheel <path> -Sha256 <published-hash>`, or `install.sh --release <version> --manifest-sha256 <trusted-manifest-hash>` / `install.ps1 -Release <version> -ManifestSha256 <trusted-manifest-hash>`. Wheel mode verifies checksum/package/version; release mode selects one of five native tags for the target Python and verifies size/hash/identity before invoking the original owner. No frontend toolchain or extra selector package is installed; the manager still checks Python/dependencies. Hashes must come from trusted metadata, not an unknown publisher.
|
||||
|
||||
Release downloads use official GitHub HTTPS hosts and configured HTTPS proxy; retain wheel sources at their recorded paths, including `~/.nanobot/downloads/releases` or `NANOBOT_RELEASE_CACHE`. Failed partial downloads are removed. Wheel-mode `--dry-run` / `-DryRun` verifies without installation/setup; release-mode dry-run checks only the manifest, creating no wheel/cache/environment/setup and proving neither wheel bytes nor dependency resolution.
|
||||
|
||||
These exact-version handoffs do not discover Preview, change subscriptions, stop gateways or back up data. Require stopped writers and backup first. Review extras and recorded options for plain pip, suffixed/custom installs and external owners; see the [user guide](./updating.md) and [update protocol](./update-protocol.md). Installer fixtures alone do not establish live maintenance, backup or restart safety.
|
||||
|
||||
### Packaged upgrade and recovery acceptance
|
||||
|
||||
Linux/Windows native CI runs `scripts/verify_packaged_update.py` against its wheel; manual candidate preparation uses the assembled Linux wheel. Run macOS acceptance against the candidate's macOS wheel:
|
||||
|
||||
```bash
|
||||
<build-tools-python> -I scripts/verify_packaged_update.py \
|
||||
--wheel <exact-native-wheel> --commit <candidate-commit> \
|
||||
--output <new-private-acceptance-directory>
|
||||
```
|
||||
|
||||
Build tools need project Python dependencies. The probe creates disposable venv/account/configuration/workspace and loopback gateways, without maintainer data, models or credentials. It records the unchanged healthy target's SHA-256 and candidate commit; faulted private wheels must never be uploaded.
|
||||
|
||||
On a local macOS desktop, add `--dock` to verify the real AppKit helper alongside these journeys. The managed receipt must make `nanobot webui --yes --no-open` detach automatically; each applicable running version must have one helper, preserve desktop intent through upgrade/recovery and a second start, and remove its helper on stop. Historical packages without Dock support gain the icon only after their first healthy upgrade and an explicit WebUI launch. This is process/lifecycle acceptance, not a visual Dock-click test; do not enable it on headless CI or claim native Windows/Linux icon coverage.
|
||||
|
||||
Require normal and consecutive upgrades, skipped Preview, import/startup failure, backup failure after shutdown, worker termination, partial metadata loss and interruption between program-restoration renames. Each successful journey must show the expected version in a new gateway run, a retained verified backup, authenticated history reads, continued writes and a second ordinary start. Each recovered service must then update to the healthy target with the same account/conversations. Faults affect the first job; backup failure must survive its automatic retry, while a separately confirmed next update can make a healthy backup. The instrumented intermediate Preview's second hop installs the unchanged final wheel.
|
||||
|
||||
Compare configuration, retained legacy-source bytes, canonical SQLite records, WebUI transcripts and pending `delivery/outbox.sqlite3` records separately. Cover canonical-only, display-only and mixed history without inventing canonical records for display-only chats; SQLite checkpoint byte changes alone are not data loss. Retain the protocol-1 parked-gateway regression across old/new protected-store inventories: no outbox initialization, migration or writes outside the old grant before activation. See the [update protocol](./update-protocol.md) for scope and lease requirements.
|
||||
|
||||
Default baselines are labelled target-derived fixtures, not historical compatibility evidence. For release acceptance, add `--baseline-wheel <previously-accepted-wheel>` and repeat with supported stable and older Preview packages, including skipped Preview. Baseline feed transport is instrumented; the healthy target is unchanged. Include a retained pre-SQLite updater to check JSONL migration's canonical message bodies separately from display history. If recovery restores JSONL code, mark SQLite checks not applicable, not passed. Packages without this updater need separately recorded installation-owner bootstrap acceptance.
|
||||
|
||||
Exercise consecutive updates in the same disposable account with existing conversations through each applicable owner: official installer, uv tool, pipx, ordinary pip venv and source. Check recorded constraints/options before/after, execute the offered command, verify the restarted gateway, append a message and start again. Policy refusal must leave installation unchanged; custom owner-reviewed updates do not prove automatic recovery. Container replacement requires a real engine and retained data volumes, not a mocked marker.
|
||||
|
||||
For installer-owned background recovery, verify one exact-target repair, then original-program restoration only before activation and only with unchanged protected data, including restart/health verification without browser or terminal intervention. Data changes, activation, live owners or changed installation ownership must prevent unsafe rollback. Other owners retain their repair route. Never delete jobs/fences or automatically restore old configuration/chat data. Exercise native Windows locks/renames. Loss of both supervisor and worker, permanent storage damage and incompatible data writes are not automatically recoverable; retain these limits in release notes and the operator guide.
|
||||
|
||||
Keep private evidence until review; it can contain program generations/backups and is not an upload set. CI retains small reports, including completed cases after a later failure; only all selected journeys passing produces aggregate success. Partial reports or a timeout are not an overall pass. Record actual native OS/CPU coverage separately from installer/startup fixtures: Linux x64, Windows x64 and macOS arm64 do not establish macOS x64 or Linux arm64 coverage. Controlled release transport and fault injection prove neither public downloads nor interactive UI; complete those gates before claiming them.
|
||||
|
||||
## Stable and Preview subscriptions
|
||||
|
||||
Use [Updating nanobot](./updating.md) for Settings → About and CLI instructions. Release acceptance must preserve opt-in consent: Preview is off even on development builds; switching saves/checks a feed, not installation approval. Require separate exact-version confirmation and a Preview risk warning. Profiles sharing an environment/account share its subscription; other installations/accounts do not. Environment replacement may require reselection; browser storage is not authoritative.
|
||||
|
||||
| Current install / requested channel | Required acceptance result |
|
||||
| --- | --- |
|
||||
| Stable → Preview, a newer verified preview exists | Offer that exact preview; install only after confirmation. |
|
||||
| Preview → Preview | Offer only a higher verified version, including a final release. |
|
||||
| Preview → Stable, stable is newer | Offer the final release; keep Stable selected. |
|
||||
| Preview → Stable, stable is older | Save Stable and wait for a newer final release; keep running the preview. |
|
||||
| Preview subscriber installs a final release | Keep Preview selected for the next development cycle. |
|
||||
| Current preview was withdrawn | Warn even without a safe newer replacement; never silently downgrade. |
|
||||
| Feed offline, incomplete, missing or incompatible | Return non-success; retain subscription and allow rechecking. |
|
||||
|
||||
Stable checking/planning requires complete PyPI wheels/sdist. Preview uses `release-index/catalogue.json` and exact GitHub manifests, never PyPI `--pre` or arbitrary branches. Validate targets against the gateway interpreter/platform, not the browser. Index final releases for Preview subscribers too; advance only after verifying all referenced public assets.
|
||||
|
||||
Versions, tags and manifest hashes are immutable. Increment generation; never rewind or clear published pointers, remove withdrawals or reuse bad versions. To stop offering a version, retain its pointer and withdraw it. Serialize writers and validate `ReleaseCatalogue.validate_successor(previous)` against the latest catalogue. Clients reject rewrites relative to their last accepted catalogue; that check is not cryptographic signing.
|
||||
|
||||
Acceptance must invalidate reviews on every channel change, including Stable → Preview → Stable; cancel inactive staged work through normal stop checks and retain diagnostics. Active preparation, committed shutdown, admitted installation or failed mutation blocks switching until settled/recovered. Reject stale-tab writes and reread after lost responses, never automatically retry installation. Detailed transaction rules belong in the [update protocol](./update-protocol.md).
|
||||
|
||||
Discovery grants no installation authority. Only the official managed venv and supported POSIX uv transactions support the reviewed stop/install/restart flow; pipx, source, container, system-managed, unsupported uv/platform and desktop distributions retain their owner/distributor route. Remote browsers without package-install permission may read status but not change subscription. Older clients must get actionable failures for unrepresentable statuses, never false “up to date.” Verify these boundaries before announcing a public channel.
|
||||
|
||||
## Non-publishing preview preflight
|
||||
|
||||
**Verify Release Candidate** is manual, read-only preparation: no tags/releases, PyPI or catalogue writes. It builds/checks five platform wheels, sdist and licensed fallback archives. Cross-compilation is neither native execution nor release approval.
|
||||
|
||||
Default retention is small identity/manifest/probe reports and installation guide for **three days**, without installable binaries. `retain_installable` preserves those exact checked artifacts plus a self-contained shallow Git repository for **one day** (about 400 MB). Keep this storage exception off for routine preflight or schedules; assess storage and call it out explicitly in workflow-change PRs before merge. Preserve approved handoffs before expiry; rebuilding expired files cannot reuse their verification. The source contains only candidate/source-parent history, not configuration or untracked files. `handoff.json` is written only after copied artifacts verify; interruption is not an accepted handoff.
|
||||
|
||||
After assembly, the workflow installs the Linux x64 wheel and binary dependencies into a separate venv without Bun/Node/Git on the install PATH. Isolated Python checks version/commit/import identity, all Vite-manifest assets including lazy chunks through the installed handler, and bundled TUI `--desktop-protocol` with downloads disabled and empty private HOME. With `--gateway`, it starts a private foreground CLI gateway with no provider/MCP configuration, disabled heartbeat and two loopback ports, then checks readiness, protected version identity, HTML and process/listener cleanup. Unix shutdown must be graceful; Windows termination is labelled, not graceful-shutdown evidence. No model task or external channel is exercised.
|
||||
|
||||
On another supported platform, check a disposable native installation without changing its package:
|
||||
|
||||
```bash
|
||||
<installed-venv-python> -I scripts/verify_installed_release.py \
|
||||
--version <candidate-version> --commit <candidate-commit> \
|
||||
--gateway --report <new-report-path>
|
||||
```
|
||||
|
||||
Use the candidate commit, not its parent. The probe rejects checkout imports/unisolated invocation and avoids user configuration/credentials. Omit `--gateway` for assets/TUI only. Reports identify OS/CPU/probes and are success-only, never overwritten; failure cleans up children and prints a bounded redacted log tail. This is package/startup evidence, not interactive UI, managed restart, migration, public-download or five-platform E2E acceptance.
|
||||
|
||||
For local preparation, use a full source SHA and new output outside the checkout (illustrative base/sequence):
|
||||
|
||||
```bash
|
||||
python -m scripts.release_candidate prepare \
|
||||
--source-commit <full-commit-sha> --base 0.3.6 --sequence 42 \
|
||||
--output <new-candidate-directory>
|
||||
```
|
||||
|
||||
Preparation leaves the checkout untouched and deterministically creates a version-only commit for identical inputs. Build Python distributions and all native targets from it, then run from the candidate:
|
||||
|
||||
```bash
|
||||
python -m scripts.release_candidate assemble --source-commit <original-source-sha> \
|
||||
--wheel <intermediates>/nanobot_ai-0.3.6.dev42-py3-none-any.whl \
|
||||
--sdist <intermediates>/nanobot_ai-0.3.6.dev42.tar.gz \
|
||||
--tui-dir tui/dist --output <new-artifact-directory>
|
||||
```
|
||||
|
||||
Assembly refuses existing output and emits the manifest only after complete-set, version/commit, WebUI, RECORD, native/source and permissions checks. It compares sdist sources/resources against tracked candidate files with packaging exclusions, and all wheels' application/WebUI bytes against the sdist. Commit markers and RECORDs alone are insufficient; these comparisons do not prove reproducible frontend/native compilation. Recheck with `python -m scripts.release_candidate verify --source-commit <original-source-sha> --artifacts <artifact-directory>`; it may reuse an identical manifest, never replace different bytes.
|
||||
|
||||
Generate the handoff from the same candidate:
|
||||
|
||||
```bash
|
||||
python -m scripts.release_candidate instructions --source-commit <original-source-sha> \
|
||||
--artifacts <artifact-directory> --output <new-install-guide-path.md>
|
||||
```
|
||||
|
||||
The generator rechecks artifacts/manifest and writes a non-overwriting guide outside the immutable upload directory. When both installers match the supported implementation, commands fetch the exact candidate's installer with the retained manifest hash for automatic platform selection; older candidates keep manual commands, never mutable `main` or assumed flags. Publication must make pinned installer source reachable.
|
||||
|
||||
The guide records version, source/candidate commits, five hash-bound wheel URLs and separate new/existing base-package commands for uv, pipx and pip venv. Commands verify local size/SHA-256 with the standard library before manager invocation; URL hash fragments alone are insufficient for the tested uv commands. Retain wheel paths recorded by managers. Manual commands move to an advanced section when automatic entry is supported; no new manifest schema or installer executable is introduced.
|
||||
|
||||
Before offering the guide, publish/verify exact public files and add release changes, native coverage, migration/recovery instructions and stop/backup prerequisites. Review extras and locked/suffixed/external-owner options; independently verify installed version and restarted gateway. Manager fixtures do not prove restart/migration, and the guide is neither publication approval nor channel selection.
|
||||
|
||||
The candidate clone borrows source Git objects; preserve its source repository until retained in an approved permanent ref. Partial assembly has no accepted manifest and must not be uploaded. Source-offer commitment, native launch, clean install, upgrade/recovery and publication gates still apply. Missing public assets must be recovered from original verified files, never overwritten by rebuilds.
|
||||
|
||||
Retain an exact local handoff outside temporary build storage:
|
||||
|
||||
```bash
|
||||
python -m scripts.release_candidate retain --source-commit <original-source-sha> \
|
||||
--artifacts <verified-artifact-directory> --output <new-retained-directory>
|
||||
```
|
||||
|
||||
Only `artifacts/` is the upload set; `source.git/`, `install.md` and `handoff.json` are maintenance evidence, not PyPI packages. Restore with `git clone --no-local <retained>/source.git <new-checkout>`, check HEAD against `handoff.json`, and rerun `release_candidate verify` on retained artifacts before separately approved publication. Keep native reports and release notes alongside them; retention adds no native, migration, interactive UI or public-download evidence.
|
||||
@@ -102,13 +102,13 @@ If the installer finishes without opening the browser and `nanobot` is available
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
If the terminal cannot find `nanobot`, take the exact command printed by the installer and replace its final arguments with `webui`. That command may begin with `uv tool run`, `pipx run`, or the full path to nanobot's private Python environment.
|
||||
If the terminal cannot find `nanobot`, take the exact command printed by the installer and replace its final arguments with `webui`. It uses the Python executable from the persistent installation, not a temporary tool environment.
|
||||
|
||||
On SSH, a computer without a desktop, an existing configuration, or an older nanobot release, the installer may open the terminal wizard instead. Choose **Quick Start** there and follow its prompts.
|
||||
|
||||
## 5. Get the First Reply
|
||||
|
||||
Leave the WebUI terminal open. If the browser did not open automatically, copy the complete login link printed in that terminal, including everything after `#`, into your browser. The bare `http://127.0.0.1:8765` address does not sign a new browser in. Keep the login link private: it contains a credential.
|
||||
Wait for the startup summary. If the browser did not open automatically, copy the complete login link printed in that terminal, including everything after `#`, into your browser. The bare `http://127.0.0.1:8765` address does not sign a new browser in. Keep the login link private: it contains a credential. Fresh official-installer environments keep running in the background; if the launcher remains attached, leave that terminal open.
|
||||
|
||||
Send this message:
|
||||
|
||||
@@ -137,7 +137,7 @@ You can also follow the steps yourself using the controls and guides below. Add
|
||||
|
||||
Repository docs show the current development version. If your stable package does not yet show **Channels**, use the [Chat Apps guide](./chat-apps.md) or update to a release that includes it.
|
||||
|
||||
Some runtime changes ask you to restart nanobot. Use the restart action shown by the WebUI, or return to the terminal, press `Ctrl+C`, and run `nanobot webui` again.
|
||||
Some runtime changes ask you to restart nanobot. Use the restart action shown by the WebUI or `nanobot gateway restart` for a background gateway. For an attached on-demand launcher, press `Ctrl+C` and run `nanobot webui` again.
|
||||
|
||||
For a chat platform's account, bot, token, or permission prerequisites, use the [Chat Apps guide](./chat-apps.md). For local models and provider-specific recipes, use the [Provider Cookbook](./provider-cookbook.md).
|
||||
|
||||
@@ -166,7 +166,7 @@ nanobot agent -m "Hello!"
|
||||
| `nanobot: command not found` | Reuse the exact nanobot command printed by the installer; it points to the isolated environment that contains the package |
|
||||
| `401`, unauthorized, or invalid API key | The key is wrong, expired, or belongs to a different provider |
|
||||
| Model not found | The model ID is misspelled or unavailable to your provider account |
|
||||
| Browser does not open | Copy the complete login link printed by the launcher, including the fragment after `#`, and keep the terminal running |
|
||||
| Browser does not open | Copy the complete login link printed by the launcher, including the fragment after `#`; keep the terminal open if the launcher is attached |
|
||||
| Browser opens but messages fail | Test `nanobot agent -m "Hello!"` to separate a model problem from a WebUI problem |
|
||||
| A change was saved but nothing changed | Restart nanobot so the running process reloads the config |
|
||||
|
||||
@@ -182,4 +182,4 @@ Run:
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
Leave that launcher open while you use nanobot. Pressing `Ctrl+C` disconnects it; the shared gateway stops when it was the last local WebUI or TUI client. After the normal foreground start and model setup work, use `nanobot gateway --background` when you want the gateway to stay online with no clients; then manage it with `nanobot gateway status`, `logs`, `restart`, and `stop`.
|
||||
A fresh official-installer environment starts a background gateway and returns control to the terminal. Closing the browser does not stop it. Manage it with `nanobot gateway status`, `logs`, `restart`, and `stop`; use the exact commands printed for your instance. Other installation methods keep their attached on-demand launch: leave that launcher open, or explicitly use `nanobot webui --detach` after setup. The last attached client stops an on-demand gateway, not a background gateway. See [updates and recovery](./updating.md) for the matching installation method.
|
||||
@@ -0,0 +1,88 @@
|
||||
# Update protocol
|
||||
|
||||
This document is for gateway, client and updater maintainers. For installation choices, WebUI steps and recovery commands, see the [user update guide](updating.md). Release approval, catalogue and artifact schemas belong to the [release contract](releasing.md).
|
||||
|
||||
## Ownership and approval boundaries
|
||||
|
||||
The gateway owns policy, installation inspection and durable update state; clients present reviews and explicit consent. Reviewing a release, preparing files, approving shutdown, admitting package mutation and activating a gateway are separate decisions. None can be inferred from another's progress, a lost response or elapsed time.
|
||||
|
||||
An [immutable plan](../nanobot/update_plan.py) binds an exact release artifact to the interpreter/environment snapshot, ownership receipts, extras, channel revision and known gateway profiles. Its lifetime is at most fifteen minutes. Preparation and shutdown preflight revalidate that target, never substitute a new latest version. Changed environment metadata, ownership, profiles, channel revision, expiry or release eligibility blocks progress. Planning and preflight share the installation's `releases` history: catalogue rollback or changed contents under the same generation must not become acceptable through a fresh per-job cache. A network failure is not a fresh successful check. See [release discovery](../nanobot/release_feed.py) and the [release contract](releasing.md) for approval and download rules.
|
||||
|
||||
[Manager policy](../nanobot/update_manager.py) comes from the owner's receipt, not dependency-based guesses. Its hash binds the complete private settings; the review uses a credential-free summary of extras, constraints, source, pins/locks and additional package names. An absent `owner_restriction` is not execution eligibility. Supported pipx receipt schemas are `0.5` and `0.12`; reading them does not enable pipx execution or newer manager flags. The native uv transaction is limited to compatible POSIX uv `0.11.16` registry tools and preserves receipt policy. Unfrozen external resolver policy requires the owner's workflow. A plain-venv transaction requires explicit extras, including `[]` for the base package; installer- or manager-recorded extras cannot be replaced by a client.
|
||||
|
||||
## Client interface
|
||||
|
||||
Capabilities are optional additions to the [WebUI contract](../nanobot/webui/client_contract.py), not package-version comparisons or a higher protocol floor. Action names below have the prefix `settings.nanobot.update.`; read paths have the prefix `/api/settings/nanobot-update/`.
|
||||
|
||||
| Capability | Interface |
|
||||
| --- | --- |
|
||||
| `webui.update-plans.v1` | `plan`; `GET plan?id=<id>` |
|
||||
| `webui.update-jobs.read.v1` | `GET job?id=<id>` |
|
||||
| `webui.update-jobs.prepare.v1` | `prepare`, `settle` for interrupted preparation |
|
||||
| `webui.update-jobs.execute.v1` | `execute` |
|
||||
| `webui.update-jobs.retry-handoff.v1` | `retry` |
|
||||
| `webui.update-jobs.settle-handoff.v1` | `settle` also retires inactive, uncommitted handoffs |
|
||||
| `webui.update-channels.v1` | `channel` with the saved revision |
|
||||
| `webui.update-flow.v1` | Client flow using review, preparation, execution and reconnection |
|
||||
|
||||
All routes require authentication. Actions require an authenticated WebSocket; plain HTTP cannot create plans or mutate jobs. Preparation, settlement, execution, retry and channel changes also require the existing local-browser or explicit remote package-install permission and runtime admission checks. Review does not require installation permission. Desktop's native surface retains its distributor's updater. [Transport routing](../nanobot/webui/settings_routes.py) and the [settings handler](../nanobot/webui/settings_system.py) own these checks; update responses are `no-store`.
|
||||
|
||||
`plan` accepts only `channel`, `restart_running` (default `false`) and optional `extras`. The default channel is the installation preference, or Stable when absent. It cannot accept a download URL, command, environment path or caller-supplied plan. `restart_running=true` selects known running background gateways with explicit lifetime and cooperative shutdown support, not stopped profiles or unknown supervisors. Inline eligibility requires the requesting gateway and every running peer in the reviewed stop/restart selection, with no unconfirmed owner.
|
||||
|
||||
The review separates `installation_allowed` (caller policy) from `execution_available` and `execution_blocked_reason` (exact-plan eligibility). Neither authorizes execution. `validity` is a local snapshot result: `current`, `expired`, `installation_changed`, `profiles_changed` or `channel_changed`. Reading a saved review can inspect the current installation and profiles, but does not contact the release feed or choose another target.
|
||||
|
||||
Job actions use `id`; execution additionally requires `confirm_restart: true`, and retry requires `previous_confirmation_id`. A job read returns durable facts including `recorded_phase`, `attempt`, `mutation_started`, `updated_at` and `execution_confirmation_id`, not worker liveness or permission to retry. Missing jobs return 404, invalid identifiers 400, and corrupt or misbound records 409. Reads do not start the installation's Python, contact release services or take its runtime lease; an active writer or incomplete-install marker does not hide history. Environment-path scoping can retain history after a reinstall, but does not authorize resuming the predecessor's job. Raw logs, resolver credentials and diagnostic messages are not exposed. Recovery flags distinguish automatic recovery selection, supervisor ownership and restored service. A returned recovery command is display-only.
|
||||
|
||||
[Record publication](../nanobot/utils/atomic_file.py) is atomic, never delete-then-copy. Windows snapshot readers share deletion so polling can coexist with POSIX-style replacement on supported filesystems. Sharing and permission failures remain errors, not permission to publish partial records.
|
||||
|
||||
Channel changes use revision checks, invalidate old reviews and retire only safely settled inactive jobs. They never install, downgrade or discard active work. Consumers recover lost preparation/execution responses by reading the same job; a missing journal or transport timeout alone is not authority to submit a replacement operation.
|
||||
|
||||
## Preparation leases and settlement
|
||||
|
||||
[Preparation](../nanobot/update_jobs.py) saves the immutable plan and a preparation journal before native inspection or resolution. It compares fresh environment metadata before and after staging, verifies the exact nanobot wheel and stages the resolved dependency transaction without changing installed files. Pip preparation retains its configured package-source trust policy; credential-bearing resolver files remain private and temporary. There is no source-build or global-manager fallback. For uv, a sealed private preparation cache and recorded dependency versions bind the offline transaction without rewriting the shared cache or saved policy.
|
||||
|
||||
The frozen worker and helpers are standard-library-only and stored outside the installation. [Preparation children](../nanobot/update_process.py) start with `-I -S`, acquire their own runtime and native-preparation leases, validate the preparation generation, then initialize the target's site. Those leases cover `.pth`/site hooks, the actual probe or pip command and `atexit` cleanup, even if the parent disappears. Python commands run in the lease-owning process on POSIX and Windows. Native uv uses POSIX `exec` with retained descriptors; inherited handles do not transfer Windows byte-range lock ownership. Failed `exec` restores descriptor inheritance flags. These leases do not contain arbitrary descendants spawned by custom hooks.
|
||||
|
||||
Cancellation does not release preparation ownership until native work actually returns. An orphan native child blocks another preparation and coordinated shutdown. A `preparing` record alone proves neither liveness nor completion. Settlement requires both parent and native preparation leases, revokes that generation and records `preparation_failed`; it neither deletes staging nor starts an install. Late children from the revoked generation cannot run. Older parent-only lease records cannot establish this proof. Retrying preparation must retain the same immutable plan; changed consent needs a new ID.
|
||||
|
||||
The immutable `request.json`, written after inputs and initial status are flushed, is the preparation commit record. A `ready` journal alone is insufficient. Preparation grants no package-mutation authority.
|
||||
|
||||
## Confirmation generations and offline execution
|
||||
|
||||
The [job service](../nanobot/update_service.py) persists execution confirmation before launching a detached owner. Each confirmation may claim the operation once. Replaying execute, repeating a retry or presenting a stale predecessor returns history, not another attempt. Explicit retry replaces exactly `previous_confirmation_id` while worker and preflight leases are free; delayed launchers with the replaced confirmation cannot start. The original target, artifacts, plan expiry, release checks and selected runtime identities still apply. Retry cannot extend the review or repair mutation.
|
||||
|
||||
Confirmation identity and expiry are separate checks. Launch consent is short-lived and bound to the immutable request. Under its lease, the supervisor validates that identity before publishing even its first journal or launching work. Completion and bounded recovery, including restoration, retain the same identity without reapplying the launch-window expiry. Fresh local repair can renew approval only for an already admitted exact job, not prepared files alone; it rechecks inputs and environment, preserves and verifies the original backup once created, and never resolves or downloads a release.
|
||||
|
||||
The [offline worker](../nanobot/update_worker.py) uses the base Python with `-I -S`. Its actual installer child owns exclusive installation/data leases before target site initialization and rechecks ownership, environment, inputs and approval before mutation. Pip's CLI runs in that same single-use Python process on both POSIX and Windows, retaining locks through exit cleanup. It accepts only staged wheels with network resolution, builds and destination/configuration overrides disabled. Native uv retains its leases through POSIX `exec` and applies the sealed transaction offline.
|
||||
|
||||
A pending-install fence and data reservation survive interrupted mutation. Repair cannot overwrite unrelated package changes or a different target installed by another updater. Restart-phase recovery retries restart, not installation. Installed-package verification uses a separately lease-owning child and a completion checkpoint: the target must import from the correct environment, application files including bundled assets must match the wheel, and dependency checks must pass. Without restart participants the result is `installed`, not a verified running gateway.
|
||||
|
||||
## Shutdown and maintenance
|
||||
|
||||
[Installation leases](../nanobot/installation_lock.py) are account-scoped by the real environment path, independent of profile home and symlink aliases. Cooperating runtimes hold shared OS locks; mutation needs exclusive access. Lock files must never be removed or replaced: a PID file is not ownership. Ordinary startup refuses an active updater or pending-install fence. These leases do not discover older runtimes, arbitrary imports, other accounts or external supervisors.
|
||||
|
||||
The detached owner's [old-runtime preflight](../nanobot/update_handoff.py) owns a shared lease before application imports, revalidates the exact release using shared release history, closes the release client and requests [cooperative shutdown](../nanobot/update_stop.py). Every selected gateway must hold its idle admission gate before any stop is committed. Refusal before commit reopens intake; a durable commit is irrevocable and is not undone by a later failure. The owner waits for actual gateway and preflight process exit, not inactive receipts, before acquiring exclusive installation/data leases and admitting installation. Shutdown consent alone is not mutation approval.
|
||||
|
||||
[Runtime admission](../nanobot/runtime_admission.py) accounts for accepted and detached work through cleanup without cancelling active tasks. Channel setup and provider sign-in owners must stay busy until native workers, callbacks and cleanup actually exit; cancelling an awaiter, expiring a flow or returning a QR/browser response does not establish idle. Failed cleanup retains ownership for retry. See the [connector lifecycle](../nanobot/channels/connect.py) and [sign-in registry](../nanobot/webui/settings_services.py). A loaded connector without that lifecycle cannot claim coordinated-update idleness.
|
||||
|
||||
Handoff settlement requires free worker, preflight and stop-coordinator leases and refuses committed shutdown, installation admission or mutation. It records `cancelled` without deleting saved files or launching work; repeated settlement is safe. An uncertain response is resolved by reading the old job.
|
||||
|
||||
## Data protection and protected restart
|
||||
|
||||
[Profile receipts](../nanobot/update_profiles.py) preserve known stopped profiles for backup and retain original launch selectors, paths and process/run identities, not configuration contents or arbitrary environment variables. A PID alone is not liveness. A new run, changed inventory or unconfirmed owner invalidates review; inventory does not authorize stopping a supervisor or starting a previously stopped profile.
|
||||
|
||||
[Data leases](../nanobot/data_access.py) protect overlapping named stores even across cooperating Python installations. Reservations bind the exact job and scope across crashes. [Backups](../nanobot/update_backup.py) cover recorded nanobot stores and required receipts, not entire homes, arbitrary projects or external services. Redirected paths, symlinks/reparse points, special files, changing data or insufficient space block backup. The original backup is verified and retained across retries, never replaced by post-mutation data. Automatic data rollback is unavailable.
|
||||
|
||||
[Protected restart](../nanobot/update_restart.py) launches only reviewed participants through lease-owning frozen entrypoints using their saved selectors. A startup grant permits initialization of one participant's exact reserved data scope, not agent/tool/scheduler work or broader paths; its bearer is removed before normal runtime configuration. Grants cannot expand an older updater's reservation. For protocol-1 grants predating the lazy delivery store, that store takes an ordinary lease and cannot initialize, migrate or write before activation.
|
||||
|
||||
Gateways remain in maintenance until their actual run identities, target versions and readiness are verified. Durable activation names those exact runs; a generic HTTP success or receipt is insufficient. Verification after intake opens precedes fence/reservation cleanup and `succeeded`. A crash during finalization resumes cleanup only, not reinstall or activation. Clients additionally require authenticated reconnection to the target-running gateway before reporting update completion.
|
||||
|
||||
The optional macOS Dock helper belongs to the gateway, starts only after activation and exits when its owner stops. It holds no installation/data lease and is not loaded by the frozen updater or recovery supervisor. Its instance-scoped visibility intent survives reviewed restart/recovery; the helper does not own update execution or completion.
|
||||
|
||||
## Recovery and compatibility limits
|
||||
|
||||
For installer-owned dedicated venvs with selected background participants, [automatic recovery](../nanobot/update_fallback.py) preserves a verified sibling program/dependency snapshot before mutation. An independent supervisor can try the already admitted exact target once, then restore only the original program before candidate activation and only if protected user-file contents still match the original backup. Backup failure before mutation can restart the intact original program. Restoration uses journaled same-filesystem renames, retains the failed generation and replays one transient filesystem failure; duplicate launches do not gain another recovery budget.
|
||||
|
||||
Restored service is not update success: the wire result remains `failed` for older clients and adds `service_restored`. Successful upgrades may remove their redundant program snapshot but retain the data backup. Changed data or durable activation forbids older-program restoration; only same-target completion remains safe. Corrupt snapshots, changed ownership, persistent filesystem faults, missing base Python or loss of both supervisor and worker can require operator recovery. This is neither malware remediation nor an OS boot-time recovery service.
|
||||
|
||||
Compatibility is explicit, not inferred from versions. Protocol 1 covers worker request schema 4, frozen `-I -S` startup with child-owned installation leases, scoped data-startup grants and activation bound to the exact restarted run. The target must declare a supported protected-handoff contract; see [release compatibility](releasing.md#protected-updater-handoff-compatibility) for its schema and publication requirements. External managers, unsupported layouts and older jobs are not silently adopted. Hosts without settlement/retry capabilities retain their existing status/recovery route rather than accepting unsupported actions. The [standalone launcher](../nanobot/update_recovery.py) uses the saved worker and original base Python independently of a broken application environment; user commands and operational limits remain in the [update guide](updating.md).
|
||||
@@ -0,0 +1,109 @@
|
||||
# Updating nanobot
|
||||
|
||||
Use the update method that owns your installation. If your version does not include the WebUI updater, first upgrade through the original installer or package manager. This does not convert an existing installation into an installer-managed one.
|
||||
|
||||
## Update from the WebUI
|
||||
|
||||
1. Open the blue update entry in the sidebar or **Settings → About → Update**. Opening the dialog only checks the installation; it does not install or restart anything.
|
||||
2. Review the exact version and affected gateways. Active work must finish before shutdown. Gateways that were already stopped are not started by the update.
|
||||
3. Choose **Update & restart**. nanobot downloads and verifies the required files, backs up affected profiles, installs the update, and restarts the selected background gateways—not your computer or browser.
|
||||
4. Wait for **Update complete**, which requires a reconnected gateway running the target version. Choose **Done** to reload the updated interface. If you hide the dialog, reopen it through **Settings → About → View details**.
|
||||
|
||||
Inline updates support fresh official-installer environments and compatible POSIX uv 0.11.16 registry tool installations running a background gateway. Other installations show their own update instructions in the dialog; see [Installation owners](#installation-owners). Remote browsers need the gateway's explicit package-install permission.
|
||||
|
||||
On a local macOS desktop, the background WebUI's Dock icon stays available after closing the terminal and disappears when the gateway stops. A restarted or restored gateway recreates it after activation; it may disappear during package replacement and is not an update progress indicator. `--no-dock` remembers your choice for that instance. See the [Dock controls](webui.md#macos-dock-icon).
|
||||
|
||||
Automatic installation requires official release approval and verified package checksums for both Stable and Preview. If verification fails, keep using the current version, retry later, and report persistent errors to a maintainer. Do not disable verification or install a replacement file from an error message. Verification confirms release approval; it is not a guarantee that all application or dependency code is harmless.
|
||||
|
||||
## Stable and Preview
|
||||
|
||||
**Settings → About → Receive preview updates** is off by default. Enable it to try new features earlier, with a higher risk of bugs. The preference applies to this installation, not just the browser; changing it requires the same local or remote permission as installing packages. It never downloads, installs, or restarts on its own.
|
||||
|
||||
Turn it off to receive only stable updates. If your Preview is newer than the latest stable release, nanobot keeps it until a newer stable release is available; it does not downgrade or restore old data. Installing a final release while Preview is enabled keeps Preview enabled for the next development cycle. You can skip intermediate previews.
|
||||
|
||||
Stable fixes can arrive between feature releases. Preview availability depends on verified publication, not a promise of daily updates. Package-manager commands outside nanobot do not read this preference; choose their version or channel explicitly.
|
||||
|
||||
## Installation owners
|
||||
|
||||
When inline installation is unavailable, the update dialog identifies the installation method and guides you through its update. Run copied commands **on the gateway computer, as the original installation account**. For containers, use the deployment host rather than treating a container path as a host path.
|
||||
|
||||
| Installation | Update route |
|
||||
| --- | --- |
|
||||
| Fresh official installer | Use WebUI **Update & restart** for a compatible release. Existing unrecorded environments are not automatically adopted. |
|
||||
| uv registry tool | Use the supported inline flow above, or `uv tool upgrade nanobot-ai` in its original environment. Keep recorded extras, constraints and additional packages; a pin needs an explicitly reviewed new constraint. |
|
||||
| pipx | Use `pipx upgrade nanobot-ai` only for an unconstrained registry install without recorded pip options. Otherwise preserve the original requirement, index/options, suffix and injected packages through the owner's workflow. |
|
||||
| Ordinary pip venv | Use that environment's Python with `-m pip install --upgrade 'nanobot-ai[<your existing extras>]'`; omit brackets for the base package. Do not guess optional extras. |
|
||||
| Source checkout | Preserve local changes, update the selected ref and environment, and follow the [development instructions](../CONTRIBUTING.md). Source is not the Preview release channel. |
|
||||
| Docker / Compose | Pull or build the selected image and recreate the service with its existing data volumes. Do not pip-install into a running container. |
|
||||
| OS package, service manager or Desktop | Use the distributor or deployment's updater and launcher. |
|
||||
|
||||
For an external update, stop all affected writers, back up configuration and data, update through the original installation method, then restart the same profiles through their original launcher. New versions may migrate stored data. Verify the **running** version in **About** and check that configuration and conversations remain available. Package-manager success alone does not verify the gateway, and manual updates do not inherit the managed updater's automatic recovery.
|
||||
|
||||
Do not switch package managers to work around an error. Fixed wheel sources, locked requirements and custom installations need their original settings reviewed. If a fresh official installation fails, fix the reported prerequisite or network error and rerun the same installer command.
|
||||
|
||||
## Recover an interrupted update
|
||||
|
||||
Refreshing restores saved progress, **not installation consent**. A staged update may ask you to review and confirm it again. A disconnected page cannot tell whether the worker stopped: do not start another installation while it reconnects. Closing the browser does not stop the managed update or its recovery.
|
||||
|
||||
**Check again** only reads saved status. **Review update** asks the gateway to settle an interrupted preparation or failed handoff before opening a fresh review. Settlement is refused while an owner is active or the operation has progressed too far to discard safely. It does not prepare or install another update; that requires a separate **Update & restart** confirmation.
|
||||
|
||||
If settlement is refused or its response is lost, the saved job remains available for status checks and recovery. A timeout or missing response is not permission to create a second update. After package changes have begun, use recovery rather than trying another installation.
|
||||
|
||||
## Automatic service recovery
|
||||
|
||||
For installer-owned dedicated environments with supported background gateways, the update confirmation also authorizes bounded recovery of that exact operation. nanobot retains a separate copy of the original program and dependencies before changing packages; insufficient space aborts installation.
|
||||
|
||||
If installation fails, recovery tries the already approved target once using saved files. If that also fails before the new gateway is activated, it can restore the original program and restart the reviewed gateways **only if protected user data is unchanged**. The dialog reports **Previous version restored**, not update success. A restored service needs a fresh review before another update.
|
||||
|
||||
Recovery never replaces current configuration or conversations with an old backup. Changed user data, missing or corrupt saved files, changed installation ownership, persistent disk errors, a missing base Python, or loss of both recovery processes can require operator help. Keep the saved job and backup; do not delete recovery markers or install over them. This is not recovery after every power loss or a guarantee against malicious code. Other installation methods retain their original recovery route.
|
||||
|
||||
## Standalone recovery
|
||||
|
||||
When automatic recovery is unavailable or reports failure, the WebUI can show a repair command containing the saved job ID and exact Python and launcher paths. Copy that command and run it **on the gateway computer, as the original OS user**. It does not require a working nanobot environment, but it does need the original base Python.
|
||||
|
||||
The following examples assume the gateway uses your terminal's normal home directory and a Python 3.11+ command. Prefer the exact paths shown by the WebUI when they differ.
|
||||
|
||||
macOS / Linux:
|
||||
|
||||
```sh
|
||||
python3 -I -S ~/.nanobot/updates/recover.py <job-id>
|
||||
python3 -I -S ~/.nanobot/updates/recover.py <job-id> --repair
|
||||
```
|
||||
|
||||
Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
python -I -S "$env:USERPROFILE\.nanobot\updates\recover.py" <job-id>
|
||||
python -I -S "$env:USERPROFILE\.nanobot\updates\recover.py" <job-id> --repair
|
||||
```
|
||||
|
||||
The first command only inspects the job. `--repair` shows its saved version, environment and backup, then asks for confirmation; `--yes` skips that prompt only when used with `--repair`. Repair reuses the same verified files without downloading another release. If installation finished but restart failed, it retries restart rather than reinstalling packages. Merely preparing files does not make a job eligible for repair.
|
||||
|
||||
Keep the original job directory and backup until recovery is verified. Missing or changed files and an independently modified environment require operator repair. Do not restore backups over live data. Downgrading and restoring user data are separate, owner-managed operations.
|
||||
|
||||
## Review an exact release
|
||||
|
||||
```bash
|
||||
nanobot update --plan
|
||||
nanobot update --plan --channel preview
|
||||
```
|
||||
|
||||
These commands save a plan showing the installation method, installed and running versions, exact target, download details and expected action. They may write plan and metadata-cache files, but do not install, stop tasks or restart gateways. `--channel` is a one-time inspection; it does not change your saved subscription.
|
||||
|
||||
Plans expire after fifteen minutes. Execution rechecks the reviewed release and refuses changed installations, withdrawn releases or changed artifacts. A plan is not installation permission. The separate `nanobot update`, `--check` and `--dev` commands do not execute saved plans; see the [CLI reference](cli-reference.md#updating).
|
||||
|
||||
## Explicit recovery before package mutation
|
||||
|
||||
If shutdown failed **before package changes began** and the application environment is still intact, you can inspect the saved job and explicitly retry its reviewed operation:
|
||||
|
||||
```bash
|
||||
nanobot update --job <plan-id>
|
||||
nanobot update --job <plan-id> --retry-handoff \
|
||||
--previous-confirmation <execution-confirmation-id> --confirm-restart
|
||||
```
|
||||
|
||||
Read the saved facts and original plan before running the second command: it approves shutdown, installation and restart, not just a connection check. The same plan must still be valid, and live owners prevent retry. An accepted request is not proof of completion; check the saved result and running gateway.
|
||||
|
||||
These commands cannot repair a broken installation or packages already changed by an interrupted update. Use [standalone recovery](#standalone-recovery) instead.
|
||||
|
||||
For contributor-facing APIs, ownership and execution rules, see [Update protocol](update-protocol.md). Maintainers should use the [release checklist](releasing.md).
|
||||
+14
-4
@@ -16,17 +16,17 @@ Use the launcher:
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
`nanobot webui` asks for one confirmation on a new installation, creates the config/workspace, enables the local WebSocket channel, and generates a WebUI bootstrap secret when one is missing. It starts or joins the same on-demand gateway used by the native TUI and opens the browser. With a fresh config, it can open before a model is configured so you can finish setup in **Settings → Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so it is not available from other devices on your LAN. The startup summary groups the login link, model setup guidance, config, and exit controls with blank lines. While attached, the launcher displays new gateway warnings and errors; use the printed logs command for full output.
|
||||
`nanobot webui` asks for one confirmation on a new installation, creates the config/workspace, enables the local WebSocket channel, and generates a WebUI bootstrap secret when one is missing. It starts or joins the same gateway used by the native TUI and opens the browser. Fresh official-installer environments start it persistently and return control to the terminal; other installations keep the attached on-demand launch. With a fresh config, it can open before a model is configured so you can finish setup in **Settings → Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so it is not available from other devices on your LAN. The startup summary groups the login link, model setup guidance, config, and exit controls with blank lines. While attached, the launcher displays new gateway warnings and errors; use the printed logs command for full output.
|
||||
|
||||
After model setup, explicitly promote the shared gateway when you do not want to keep a client open:
|
||||
Outside an installer-managed environment, use `nanobot webui --detach` to open the browser and keep the gateway running after the terminal closes. Alternatively, start or promote the same shared gateway explicitly:
|
||||
|
||||
```bash
|
||||
nanobot gateway --background
|
||||
```
|
||||
|
||||
`nanobot webui --background` is retained only to print migration guidance. This keeps one unambiguous owner for persistent process lifecycle.
|
||||
`nanobot webui --background` remains deprecated and prints migration guidance. All launch routes use the same gateway lifecycle owner and state.
|
||||
|
||||
Each foreground WebUI or TUI launcher releases only its own client. The last interactive launcher stops an on-demand gateway. `nanobot gateway --background` makes the gateway persistent; manage it with `nanobot gateway status`, `nanobot gateway logs`, `nanobot gateway restart`, and `nanobot gateway stop`.
|
||||
Each foreground WebUI or TUI launcher releases only its own client. The last interactive launcher stops an on-demand gateway, but not a persistent one. Manage the persistent gateway with `nanobot gateway status`, `nanobot gateway logs`, `nanobot gateway restart`, and `nanobot gateway stop`. Use the printed instance-specific commands when you selected a custom config or workspace. `--detach --dev` is unsupported; development remains attached.
|
||||
|
||||
The browser signs in automatically using the generated credential in the launch URL. The terminal also prints the complete login link: if automatic opening fails, copy that link into your browser, including the fragment after `#`. In WSL, the launcher opens your Windows default browser through Windows PowerShell; an explicit `BROWSER` setting takes precedence. If Windows integration is unavailable, open the printed link in your Windows browser. The plain page address does not sign in a new browser. Treat the login link as a credential and do not share it.
|
||||
|
||||
@@ -56,6 +56,16 @@ Manual config still works. Same-machine localhost WebUI access can run without a
|
||||
|
||||
The WebUI is served by the WebSocket channel on port `8765` by default. The gateway health endpoint, `18790` by default, is not the browser UI.
|
||||
|
||||
### macOS Dock icon
|
||||
|
||||
In a local macOS desktop session, `nanobot webui` shows the nanobot cat in the Dock. Click it to open the current local WebUI in your default browser. `--no-open` keeps the icon but does not open a page automatically. SSH, headless, Windows and Linux launches keep their existing behavior. A one-shot connection to an unmanaged gateway does not leave an icon behind.
|
||||
|
||||
Ordinary foreground launchers for the same instance, browser address and installation share an icon. The last WebUI launcher removes it when it exits, including after a terminal crash. For `--detach` and official-installer automatic background launch, the gateway owns the icon instead: closing the terminal does not remove it. An ordinary restart, successful update or supported automatic restoration shows it again once that gateway is activated. The icon can disappear while the service is stopped for an update; it is not an update-progress indicator. `nanobot gateway stop` removes it without changing configuration or chats.
|
||||
|
||||
Use `--no-dock` to disable the icon for a launcher. In detached mode this also remembers the choice for that instance's later restarts; running `nanobot webui` without it enables the background icon again. The request is stored beside the runtime state as a small `.dock` file, without a URL or credentials. Choosing **Hide Dock Icon** or quitting the icon hides only this shortcut, not the gateway or its tasks. It stays hidden until another explicit launch or service restart. The icon is not a standalone launcher to keep pinned when nanobot is stopped.
|
||||
|
||||
The helper uses the installed Python and macOS frameworks, with no Xcode, extra Python dependency, executable download or separate updater. Its temporary application wrapper is private to the OS user. The login URL stays in memory and a private socket, never in process arguments or a file. The helper holds no installation or data lease, and protected restart does not start it until activation. A missing image or unavailable desktop does not prevent WebUI startup, updates or independent recovery. Non-loopback browser addresses continue to use the normal browser launcher.
|
||||
|
||||
## Navigate a long conversation
|
||||
|
||||
On wide screens, use the message rail on the left to browse saved prompts; click one to jump to it. You can also search prompt summaries from the header. The WebUI loads messages near the selected prompt rather than the entire conversation. Scroll backward or forward to browse, or use the bottom arrow to return to the latest messages. If loading fails, your current content stays visible and you can retry. Older compatible hosts may only support navigation among messages that are already loaded.
|
||||
|
||||
Reference in new issue
Block a user