Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
chore: auto-save WIP via Claude stop-hook safety net (2026-07-11 11:13)
Ruben Lütked0ee41fdea37
diff --git a/docs/superpowers/specs/2026-07-06-onboarding-install-redesign-design.md b/docs/superpowers/specs/2026-07-06-onboarding-install-redesign-design.mdindex 288f11e871..4f7950671a 100644--- a/docs/superpowers/specs/2026-07-06-onboarding-install-redesign-design.md+++ b/docs/superpowers/specs/2026-07-06-onboarding-install-redesign-design.md@@ -47,10 +47,13 @@ only place Terms are recorded — removing it silently removes the legal record.## 2. Goals-- The install one-liner is **fully non-interactive**: it downloads and prepares- *everything* (code, Python deps, voice models, worker CLI, shortcuts/icon),- explains each step in one plain-English line, and launches the app **as its- last action**. When the installer says "done", the app is genuinely ready.+- The install one-liner is non-interactive when Python 3.11+ and Git exist. A+ 2026-07-11 amendment permits one explicit consent prompt when either system+ prerequisite is missing; Stage 1 installs, re-checks, and continues in the+ same process. It then downloads and prepares *everything* (code, Python deps,+ voice models, worker CLI, shortcuts/icon), explains each step in one+ plain-English line, and launches the app **as its last action**. When the+ installer says "done", the app is genuinely ready.- The **first app launch reliably shows the real desktop app** with theonboarding flow as the first thing the user sees. No broken-looking interimstate, no restarts needed.@@ -70,7 +73,7 @@ only place Terms are recorded — removing it silently removes the legal record.## 3. Design-### A. Installer: download everything, ask nothing, explain everything+### A. Installer: ask only for missing prerequisites, explain everything**A1. Remove the wizard from the install path.**- Delete `step_wizard` from `installer.py`'s default sequence. No completion@@ -194,13 +197,14 @@ Extend `fresh-install-smoke.yml` beyond "any `GET /` returns 200":3. Served `index.html` references the freshly built asset hash (stale-`dist/`guard against the "old app" failure mode; build parity with the shippedbundle).-4. Assert the installer output contains no interactive prompt markers (guards- against a wizard invocation regressing into the install path).+4. Assert prompt markers occur only in the marked Python/Git prerequisite+ state machine (guards against a wizard regressing into the install path).## 4. Error handling summary| Failure | Behavior ||---|---|+| Python 3.11+ or Git missing | Offer native package-manager installation once, await it, re-check both, and continue the same run. || Model download fails during install | Warn honestly, continue; runtime lazy-download remains the fallback (B3 shows honest status). || npm/node missing | One-line note; worker CLI installable later in-app. Never fatal. || Shortcut/AUMID registration fails | Best-effort, logged, never fatal (non-Windows: silent no-op). |@@ -216,9 +220,10 @@ Extend `fresh-install-smoke.yml` beyond "any `GET /` returns 200":- Frontend: RiskGate calls `acceptTerms`; gate retry/backoff behavior;FinishStep autostart toggle; existing parity tests stay green.- Integration/CI: extended fresh-install smoke (E1-E4).-- Manual (fresh VM): one-liner → zero prompts → app launches last → onboarding- appears immediately → complete → restart → no onboarding → re-run one-liner- (update) → no onboarding.+- Manual (fresh VM): ready prerequisites → zero prompts; missing prerequisites+ → one install-consent prompt and same-run continuation; app launches last →+ onboarding appears immediately → complete → restart → no onboarding →+ re-run one-liner (update) → no onboarding.## 6. Decided trade-offsdiff --git a/docs/superpowers/specs/2026-07-07-one-full-install-generic-wake-design.md b/docs/superpowers/specs/2026-07-07-one-full-install-generic-wake-design.mdindex e7d8bbcd5f..8abe866b69 100644--- a/docs/superpowers/specs/2026-07-07-one-full-install-generic-wake-design.md+++ b/docs/superpowers/specs/2026-07-07-one-full-install-generic-wake-design.md@@ -118,8 +118,9 @@ The non-goal "No GPU/`[local-voice]` extras in the base install (stays opt-in,AP-25)" is **amended**: the *base* install indeed stays torch-free (unchanged),but the *official installer/one-liner* now installs the full profile including`[local-voice]`. AP-25 is unaffected — it governs runtime GPU *usage*, not-packaging. The rest of that spec (non-interactive installer, prefetch,-onboarding-once) stands.+packaging. The rest of that spec (prefetch and onboarding-once) stands. Its+fully non-interactive Stage-1 rule was superseded on 2026-07-11: only a missing+Python/Git prerequisite may trigger one explicit install-consent prompt.## 5. Error handlingdiff --git a/docs/superpowers/specs/2026-07-09-install-command-forged-gold-design.md b/docs/superpowers/specs/2026-07-09-install-command-forged-gold-design.mdindex dffe82f1fd..8135c58467 100644--- a/docs/superpowers/specs/2026-07-09-install-command-forged-gold-design.md+++ b/docs/superpowers/specs/2026-07-09-install-command-forged-gold-design.md@@ -1,6 +1,6 @@# Install Command "Forged Gold" Redesign — Design-**Date:** 2026-07-09 · **Status:** approved (maintainer picked variant A + keep-URL)+**Date:** 2026-07-09 · **Status:** approved, amended 2026-07-11## Problem@@ -21,8 +21,11 @@ Decisions made by the maintainer:- **Install URL stays** (`raw.githubusercontent.com/...`) — no short domain for now.- **Terminal look becomes variant A "Forged Gold"** (branded banner gradient,numbered phases, flat finale).-- Install stays 100 % prompt-free (already true — now enforced by a guard test);- all consent lives in the app onboarding, and **declining the Terms quits the app**.+- The normal path stays prompt-free. Amendment 2026-07-11: if Python or Git is+ missing, Stage 1 asks once before installing those system prerequisites,+ re-checks them in the same process, and continues without a second command.+ All product setup consent remains in app onboarding, and **declining the+ Terms quits the app**.## Design@@ -50,7 +53,7 @@ gold, rows 5–6 gold-deep — replacing the flat single-color banner. The```P E R S O N A L J A R V I S · talk to your computer- Installs the full profile · asks nothing · launches when done+ Checks prerequisites · installs the full profile · launches when done```(first line muted letter-spaced caps, second line muted). The subtitle line@@ -62,7 +65,7 @@ One fixed six-phase journey; Stage 1 owns 1–3, Stage 2 owns 4–6:| # | Phase | Stage | Contains ||---|---|---|---|-| 1/6 | Prerequisites | 1 | Python, git, Node checks |+| 1/6 | Prerequisites | 1 | Python+Git detect/install/re-check; optional Node check || 2/6 | Fetching Personal Jarvis | 1 | clone/update, payload pin || 3/6 | Python environment | 1 | venv + bootstrap deps (merged) || 4/6 | Dependencies | 2 | pip editable + lockfile + extras |@@ -92,14 +95,21 @@ by design — the numbering documents the journey, not the entry point.Update runs keep the "no re-onboarding" promise line. Headless runs keep theserver-address hint.-### 5. Prompt-free install, enforced+### 5. Conditional prerequisite consent, tightly scoped-New static guard test in `tests/unit/install/test_installer_flow.py`:-`install.sh` contains no `read ` prompt, `install.ps1` no `Read-Host`,-`installer.py` no `input(` / `Prompt.ask` / `Confirm.ask`. Any future change-that adds a terminal question turns CI red. Existing flow tests are updated to-the new strings ("ready" instead of the panel's "Done"); launch-last ordering-stays asserted.+Amendment 2026-07-11 supersedes the original fully prompt-free Stage-1 rule.+Both shells first evaluate Python 3.11+ and Git. When both exist, they print the+versions and continue without a prompt. Otherwise they list the missing items+and ask once before invoking WinGet, Homebrew, or the detected Linux package+manager. The package-manager process is awaited, the current PATH/command cache+is refreshed, and both prerequisites are re-checked. A rare failed/manual path+keeps the same installer alive for re-check/retry until the user succeeds or+explicitly quits. `JARVIS_INSTALL_PREREQS=auto` is the explicit unattended+consent path; `never` forbids prerequisite installation.++The static guard now confines `Read-Host`/TTY `read` calls to the marked+prerequisite state machine. `installer.py` remains fully prompt-free, so the+terminal wizard or product-setup questions cannot leak back into installation.### 6. Onboarding: declining the Terms quits the app@@ -129,7 +139,8 @@ path:## Testing-- `pytest tests/unit/install/` — updated flow tests + new no-prompt guard.+- `pytest tests/unit/install/` — shell state-machine tests, scoped-prompt guard,+ existing flow and Python-detection regressions.- `pytest tests/unit/ui/` routes tests for the decline endpoint (409 afteracceptance, quit scheduling stubbed).- Frontend: RiskGate decline-state test via vitest.diff --git a/install/README.md b/install/README.mdindex 0bc66296d1..1bc3651619 100644--- a/install/README.md+++ b/install/README.md@@ -15,28 +15,34 @@ irm https://raw.githubusercontent.com/PersonalJarvis/PersonalJarvis/main/installcurl -fsSL https://raw.githubusercontent.com/PersonalJarvis/PersonalJarvis/main/install/install.sh | bash```-The installer is fully **non-interactive** and installs the **full profile**-(design 2026-07-07): everything in the repository — desktop app, telephony,-chat channels, local voice models — skipping only what the OS cannot run. It-explains each step and launches the app as its last action. All setup-questions live in the app's one-time first-launch onboarding. Re-running the-one-liner updates in place and never re-runs setup. `--headless` keeps the-minimal torch-free base (the tiny-VPS / advanced path).+When Python 3.11+ and Git are already present, the installer is fully+**non-interactive**. If either is missing, Stage 1 lists both missing items and+asks once before using the host's native package manager. It waits, refreshes+the current process environment, re-checks both commands, and continues the+same install run; no second one-liner is needed. All other setup questions+remain in the app's one-time first-launch onboarding.++The installer installs the **full profile** (design 2026-07-07): everything in+the repository — desktop app, telephony, chat channels, local voice models —+skipping only what the OS cannot run. It explains each step and launches the+app as its last action. Re-running the one-liner updates in place and never+re-runs setup. `--headless` keeps the minimal torch-free base (the tiny-VPS /+advanced path).## File layout| File | Stage | Responsibility ||-------------------|-------|----------------|-| `install.ps1` | 1 | Windows bootstrap: Python+git preflight, clone, venv, install `rich`, exec `installer.py`. |-| `install.sh` | 1 | macOS/Linux bootstrap: same shape as `install.ps1`, POSIX bash. |+| `install.ps1` | 1 | Windows bootstrap: Python+Git detect/install/re-check, clone, venv, install `rich`, exec `installer.py`. |+| `install.sh` | 1 | macOS/Linux bootstrap: same flow through native package managers, POSIX bash. || `installer.py` | 2 | Python orchestrator: pip install, optional extras, model prefetch, worker CLI, launch (last). All cross-platform logic lives here. || `README.md` | docs | This file. |## Why two stages?-Stage 1 is the smallest amount of shell we can get away with while still-being trustworthy when piped into `iex` / `bash`. Each shell script is-under 200 lines and reads top-to-bottom in under a minute.+Stage 1 is shell-native because it must work before Python or Git exists. Its+prerequisite state machine stays explicitly marked and is exercised directly+by unit tests, while Stage 2 remains in testable Python.Everything that needs branching logic (platform detection, optionalextras, error recovery, rich progress UI) lives in `installer.py`, where@@ -78,6 +84,8 @@ python install/installer.py --dry-run| `JARVIS_INSTALL_REPO` | Clone from a fork instead of the upstream repo. || `JARVIS_INSTALL_REF` | Use a branch/tag/SHA other than `main`. || `JARVIS_INSTALL_DIR` | Install to a directory other than `~/.personal-jarvis`. |+| `JARVIS_INSTALL_PREREQS` | `ask` (default), `auto` (explicit unattended consent), or `never`. |+| `JARVIS_PYTHON` | Use one explicit Python interpreter; the pin is authoritative. || `JARVIS_INSTALL_NO_PIP` | Skip the pip steps (re-run only prefetch / launch). |## Local development of the installerdiff --git a/install/install.ps1 b/install/install.ps1index ae1a033641..2fe973d618 100644--- a/install/install.ps1+++ b/install/install.ps1@@ -12,8 +12,8 @@# 6. Hands control to install/installer.py (the Stage 2 orchestrator).## All heavy logic lives in installer.py so it can be unit-tested and-# kept cross-platform. This file is meant to be read top-to-bottom in-# under 60 seconds before you paste it into a terminal.+# kept cross-platform. The shell-native prerequisite block is delimited so it+# can be tested directly even on machines where Python is not installed yet.## SOURCE-ENCODING RULE: this file is served BOM-less (a BOM breaks# `irm | iex`), and Windows PowerShell then reads it as cp1252. So the@@ -245,7 +245,15 @@ function Request-PrerequisiteConsent {function Refresh-ProcessPath {$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')- $env:Path = ((@($InitialPath, $userPath, $machinePath) |+ $commonGitPaths = @()+ if ($env:ProgramFiles) {+ $commonGitPaths += Join-Path $env:ProgramFiles 'Git\cmd'+ }+ if ($env:LOCALAPPDATA) {+ $commonGitPaths += Join-Path $env:LOCALAPPDATA 'Programs\Git\cmd'+ }+ $commonGitPaths = @($commonGitPaths | Where-Object { Test-Path $_ })+ $env:Path = ((@($InitialPath, $userPath, $machinePath) + $commonGitPaths |Where-Object { $_ }) -join ';')}@@ -309,6 +317,7 @@ function Write-ManualPrerequisiteHelp {}function Ensure-Prerequisites {+ Refresh-ProcessPath$state = Get-PrerequisiteStateWrite-PrerequisiteState $state -ShowMissingif ($state.Ready) { return $state }diff --git a/install/install.sh b/install/install.shindex 7382831fdc..d13e39bc65 100755--- a/install/install.sh+++ b/install/install.sh@@ -121,7 +121,8 @@ find_python() {# globs stay literal and are filtered by the -x test; on Linux these# directories simply don't exist and the loop is a no-op.if [ -n "${JARVIS_PYTHON_SEARCH_DIRS:-}" ]; then- # Colon-split without `read` (the never-prompts guard bans that token).+ # Colon-split without reading stdin, which still carries the piped+ # installer source in the public `curl | bash` path._old_ifs=$IFSIFS=':'# shellcheck disable=SC2086 -- colon-splitting the override is the point@@ -351,6 +352,8 @@ write_manual_prerequisite_help() {if [ "$PYTHON_READY" -eq 0 ]; thennote 'Python: https://www.python.org/downloads/'note 'Linux: install Python 3.11+ plus its venv package from your distribution.'+ note 'Already installed somewhere unusual? Pin it for this run:'+ note ' curl -fsSL <this url> | JARVIS_PYTHON=/path/to/python3.12 bash'fiif [ "$GIT_READY" -eq 0 ]; thennote 'Git: https://git-scm.com/downloads'diff --git a/tests/unit/install/test_prerequisite_bootstrap.py b/tests/unit/install/test_prerequisite_bootstrap.pynew file mode 100644index 0000000000..bc0da061ea--- /dev/null+++ b/tests/unit/install/test_prerequisite_bootstrap.py@@ -0,0 +1,228 @@+"""Stage-1 prerequisite bootstrap state-machine regression tests.++The public installer has to run before Python exists, so the implementation+must remain in PowerShell/Bash. These tests extract the marked function blocks+and drive them with deterministic state fakes: an already-ready machine must+not ask or install, while a missing Python+Git machine must install once,+re-check, and return ready to the same installer process.+"""++from __future__ import annotations++import shutil+import subprocess+from pathlib import Path++import pytest++REPO = Path(__file__).resolve().parents[3]+INSTALL_PS1 = REPO / "install" / "install.ps1"+INSTALL_SH = REPO / "install" / "install.sh"+BLOCK_BEGIN = "# --- prerequisite-bootstrap begin"+BLOCK_END = "# --- prerequisite-bootstrap end"+++def _block(path: Path) -> str:+ source = path.read_text(encoding="utf-8")+ assert BLOCK_BEGIN in source and BLOCK_END in source+ return source[source.index(BLOCK_BEGIN) : source.index(BLOCK_END)]+++def _find_bash() -> str | None:+ git = shutil.which("git")+ if git:+ for rel in ("../bin/bash.exe", "../../bin/bash.exe", "../usr/bin/bash.exe"):+ candidate = (Path(git).parent / rel).resolve()+ if candidate.exists():+ return str(candidate)+ bash = shutil.which("bash")+ if bash and not any(part in bash.lower() for part in ("windowsapps", "system32")):+ return bash+ return None+++POWERSHELL = shutil.which("pwsh") or shutil.which("powershell")+BASH = _find_bash()+++def _run_powershell_flow(tmp_path: Path, *, initially_ready: bool) -> str:+ driver = r"""+$ErrorActionPreference = 'Stop'+$PrerequisiteMode = 'auto'+$InitialPath = $env:Path+$env:JARVIS_PYTHON = $null+function Write-Ok { param([string]$Text) }+function Write-Note { param([string]$Text) }+function Write-Err { param([string]$Text) }++__BLOCK__++$script:InitiallyReady = __INITIAL_READY__+$script:StateCalls = 0+$script:InstallCalls = 0+$script:Installed = ''++function New-FakeState {+ param([bool]$Ready)+ $python = [pscustomobject]@{+ Found = $Ready+ Exe = if ($Ready) { 'python' } else { $null }+ Version = if ($Ready) { '3.12.0' } else { $null }+ Closest = $null+ }+ return [pscustomobject]@{+ Python = $python+ GitFound = $Ready+ GitVersion = if ($Ready) { 'git version 2.50.0' } else { $null }+ Ready = $Ready+ }+}++function Get-PrerequisiteState {+ $script:StateCalls += 1+ if ($script:InitiallyReady -or $script:StateCalls -gt 1) {+ return New-FakeState $true+ }+ return New-FakeState $false+}++function Invoke-MissingPrerequisiteInstall {+ param($State)+ $script:InstallCalls += 1+ $items = @()+ if (-not $State.Python.Found) { $items += 'python' }+ if (-not $State.GitFound) { $items += 'git' }+ $script:Installed = $items -join ','+ return $true+}++function Wait-ForPrerequisites { return Get-PrerequisiteState }+function Refresh-ProcessPath { }++$result = Ensure-Prerequisites+if ($null -eq $result) { throw 'flow did not return a ready state' }+$summary = "READY=$($result.Ready);INSTALLS=$script:InstallCalls"+$summary += ";ITEMS=$script:Installed;STATES=$script:StateCalls"+Write-Output $summary+"""+ driver = driver.replace("__BLOCK__", _block(INSTALL_PS1)).replace(+ "__INITIAL_READY__", "$true" if initially_ready else "$false"+ )+ path = tmp_path / "driver.ps1"+ path.write_text(driver, encoding="utf-8")+ result = subprocess.run(+ [POWERSHELL, "-NoProfile", "-File", str(path)],+ capture_output=True,+ text=True,+ timeout=30,+ )+ assert result.returncode == 0, result.stderr or result.stdout+ return result.stdout.strip()+++def _run_bash_flow(tmp_path: Path, *, initially_ready: bool) -> str:+ driver = r"""#!/usr/bin/env bash+set -euo pipefail+PREREQUISITE_MODE=auto+unset JARVIS_PYTHON || true+FOUND_TOO_OLD=''+PYTHON_EXE=''+note() { :; }+ok() { :; }+err() { :; }+find_python() { return 1; }++__BLOCK__++INITIALLY_READY=__INITIAL_READY__+STATE_CALLS=0+INSTALL_CALLS=0+INSTALLED=''++refresh_prerequisite_state() {+ STATE_CALLS=$((STATE_CALLS + 1))+ if [ "$INITIALLY_READY" -eq 1 ] || [ "$STATE_CALLS" -gt 1 ]; then+ PYTHON_READY=1+ GIT_READY=1+ PREREQUISITES_READY=1+ PYTHON_EXE=python+ else+ PYTHON_READY=0+ GIT_READY=0+ PREREQUISITES_READY=0+ PYTHON_EXE=''+ fi+}++write_prerequisite_state() { :; }+detect_prerequisite_manager() {+ PREREQ_MANAGER=fake+ PREREQ_MANAGER_CMD=fake+ return 0+}+install_missing_prerequisites() {+ INSTALL_CALLS=$((INSTALL_CALLS + 1))+ INSTALLED=python,git+ return 0+}+wait_for_prerequisites() {+ refresh_prerequisite_state+ [ "$PREREQUISITES_READY" -eq 1 ]+}++ensure_prerequisites+printf 'READY=%s;INSTALLS=%s;ITEMS=%s;STATES=%s\n' \+ "$PREREQUISITES_READY" "$INSTALL_CALLS" "$INSTALLED" "$STATE_CALLS"+"""+ driver = driver.replace("__BLOCK__", _block(INSTALL_SH)).replace(+ "__INITIAL_READY__", "1" if initially_ready else "0"+ )+ path = tmp_path / "driver.sh"+ path.write_text(driver, encoding="utf-8", newline="\n")+ result = subprocess.run(+ [BASH, str(path)],+ capture_output=True,+ text=True,+ timeout=30,+ )+ assert result.returncode == 0, result.stderr or result.stdout+ return result.stdout.strip()++[email protected](POWERSHELL is None, reason="PowerShell is not available")[email protected]("initially_ready", [True, False])+def test_powershell_rechecks_and_continues_in_same_process(+ tmp_path: Path, initially_ready: bool+) -> None:+ out = _run_powershell_flow(tmp_path, initially_ready=initially_ready)+ if initially_ready:+ assert out == "READY=True;INSTALLS=0;ITEMS=;STATES=1"+ else:+ assert out == "READY=True;INSTALLS=1;ITEMS=python,git;STATES=2"++[email protected](BASH is None, reason="Bash is not available")[email protected]("initially_ready", [True, False])+def test_posix_rechecks_and_continues_in_same_process(+ tmp_path: Path, initially_ready: bool+) -> None:+ out = _run_bash_flow(tmp_path, initially_ready=initially_ready)+ if initially_ready:+ assert out == "READY=1;INSTALLS=0;ITEMS=;STATES=1"+ else:+ assert out == "READY=1;INSTALLS=1;ITEMS=python,git;STATES=2"+++def test_windows_uses_exact_trusted_package_ids_and_refreshes_path() -> None:+ source = INSTALL_PS1.read_text(encoding="utf-8")+ assert "Invoke-PrerequisitePackage 'Python.Python.3.12'" in source+ assert "Invoke-PrerequisitePackage 'Git.Git'" in source+ assert "--exact --source winget" in source+ assert "--accept-source-agreements --accept-package-agreements" in source+ assert source.index("Refresh-ProcessPath") < source.index("$state = Get-PrerequisiteState")+++def test_posix_covers_established_native_package_managers() -> None:+ source = INSTALL_SH.read_text(encoding="utf-8")+ for manager in ("Homebrew", "apt-get", "dnf", "yum", "zypper", "pacman", "apk"):+ assert manager in source