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-02 15:49)
Ruben Lütkece12ba03b76e
diff --git a/.githooks/pre-push b/.githooks/pre-pushindex 33527f850c..d97a2eba3c 100755--- a/.githooks/pre-push+++ b/.githooks/pre-push@@ -167,6 +167,27 @@ if [ -f "$lockfile_gate" ]; thenfifi+# --- 7) BOOT BUDGET gate (FAIL-CLOSED on a measured overrun) --------------------+# A feature that sneaks heavy work onto the startup critical path must fail the+# push, not the user's day (TTU forensic 2026-07-02: a wake-model change put a+# 114.7 s load cascade on boot unnoticed). Runs ONE isolated cold boot via the+# committed harness and enforces the budgets: window <= 8 s, voice-usable and+# app-interactive <= 20 s each (~4x the measured medians, so machine variance+# never flakes while every real regression class blows through). Exit 78 =+# "could not measure" (no interpreter/harness) -> fail OPEN; a headless host+# checks the window anchor only. Costs ~30-60 s per push — pushes are rare and+# deliberate in this repo. Skip once with JARVIS_SKIP_BOOT_BUDGET=1.+boot_budget_gate="scripts/ci/check_boot_budget.py"+if [ -f "$boot_budget_gate" ] && [ "${JARVIS_SKIP_BOOT_BUDGET:-0}" != "1" ]; then+ echo "pre-push: boot-budget gate — measuring one isolated cold boot (~30-60 s) ..."+ "$PY" "$boot_budget_gate" </dev/null+ rc=$?+ if [ "$rc" -ne 0 ] && [ "$rc" -ne 78 ]; then+ status=1+ boot_budget_hit=1+ fi+fi+rm -f "$refs_file"if [ "$status" -ne 0 ]; then@@ -202,6 +223,14 @@ if [ "$status" -ne 0 ]; thenecho " See the findings above. Regenerate the platform-universal lockfile with:"echo " uv pip compile --universal --generate-hashes --python-version 3.11 --output-file=requirements.txt requirements.in"fi+ if [ "${boot_budget_hit:-0}" -ne 0 ]; then+ echo "pre-push BLOCKED: BOOT BUDGET gate (cold-boot startup budget exceeded)."+ echo " A change put work on the critical startup path. Move it behind"+ echo " _heavy_backend_bg / a deferred scan (docs/diagnostics/BOOT-TTU-NOTES.md,"+ echo " section 'How to add a feature WITHOUT slowing boot')."+ echo " Verify locally: python scripts/ci/check_boot_budget.py"+ echo " Skip once: JARVIS_SKIP_BOOT_BUDGET=1 git push"+ fiecho "Bypass once with: git push --no-verify (layer-3 CI is the backstop)."fiexit "$status"diff --git a/AGENTS.md b/AGENTS.mdindex 8d4eecd5fc..cb93abe054 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -147,6 +147,7 @@ Four tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist > whiteli| AP-23 | Build or TEST a feature only against the maintainer's own config / keys / provider / OS and claim it done | The whole API-Keys section silently bricked for every other downloader and on a headless VPS (credentials couldn't even be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). "Works on my machine" is the defect — verify the three non-maintainer paths in §3 || AP-24 | Call a shared native inference engine (ctranslate2 / faster-whisper, an ONNX / torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + the VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) || AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper, or auto-upgrade a custom-phrase (`stt_match`) wake to `large-v3-turbo/cuda` | On the maintainer's NVIDIA Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` **HANGS on every inference** (8 s timeout → self-heal drops+rebuilds the model → the cold rebuild hangs again → a vicious cycle that leaves the wake **permanently DEAF**). The same hang also appears on `base`/`cpu` when ctranslate2's auto thread-pool deadlocks against PyTorch's OpenMP in the shared process. Keep the wake on `base`/`cpu` with a FIXED `cpu_threads` (bounds ctranslate2 vs torch); `[stt].wake_high_accuracy` GPU turbo is **OFF by default** and opt-in ONLY on a GPU verified not to hang. Truly instant+accurate custom-word wake needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription (2026-06-30 live-log forensic; see `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`) |+| AP-26 | Put a new feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — a synchronous load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until the app takes 30+ s to become usable (TTU forensic 2026-07-02: one wake change put a 114.7 s load cascade on boot). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or get a `warmup_prefetch` daemon thread; routes answer a graceful 503/None while their subsystem warms. **Enforced fail-closed by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: one real cold boot; window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine + how-to: `docs/diagnostics/BOOT-TTU-NOTES.md` |---diff --git a/CLAUDE.md b/CLAUDE.mdindex 8d4eecd5fc..cb93abe054 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -147,6 +147,7 @@ Four tiers: `safe` / `monitor` / `ask` / `block`, priority **blacklist > whiteli| AP-23 | Build or TEST a feature only against the maintainer's own config / keys / provider / OS and claim it done | The whole API-Keys section silently bricked for every other downloader and on a headless VPS (credentials couldn't even be SAVED, ENV keys read as "not configured", channels/plugins/OAuth 500'd). "Works on my machine" is the defect — verify the three non-maintainer paths in §3 || AP-24 | Call a shared native inference engine (ctranslate2 / faster-whisper, an ONNX / torch session) concurrently from two callers, OR "recover" a hung inference with only a timeout that re-polls the SAME wedged engine | `WhisperModel.transcribe` is NOT thread-safe: the wake poll loop + the VAD probe sharing one provider hung it forever; a hung `to_thread` can't be cancelled, so a timeout only BOUNDS, never RECOVERS. Fix: a non-blocking per-instance inference lock (2nd call → skip) + a `recover()` that rebuilds a FRESH model after N failures (BUG-036) || AP-25 | Run the always-on wake/keyword Whisper on the **GPU** via CTranslate2/faster-whisper, or auto-upgrade a custom-phrase (`stt_match`) wake to `large-v3-turbo/cuda` | On the maintainer's NVIDIA Blackwell GPU (RTX 5070 Ti / sm_120) CTranslate2 `model.transcribe` **HANGS on every inference** (8 s timeout → self-heal drops+rebuilds the model → the cold rebuild hangs again → a vicious cycle that leaves the wake **permanently DEAF**). The same hang also appears on `base`/`cpu` when ctranslate2's auto thread-pool deadlocks against PyTorch's OpenMP in the shared process. Keep the wake on `base`/`cpu` with a FIXED `cpu_threads` (bounds ctranslate2 vs torch); `[stt].wake_high_accuracy` GPU turbo is **OFF by default** and opt-in ONLY on a GPU verified not to hang. Truly instant+accurate custom-word wake needs a trained neural KWS model (openWakeWord `custom_onnx`), NOT transcription (2026-06-30 live-log forensic; see `docs/local-wakeword/WAKE-RELIABILITY-DEEPDIVE.md`) |+| AP-26 | Put a new feature's init/import on the startup critical path (before `APP_INTERACTIVE` / `VOICE_USABLE`) — a synchronous load in `_run_backend`, the `WebServer` ctor, `_start_speech_and_orb`, or a module-level heavy import | Boot creep: every feature "only adds a second" until the app takes 30+ s to become usable (TTU forensic 2026-07-02: one wake change put a 114.7 s load cascade on boot). New subsystems hook into `_heavy_backend_bg`, a deferred registry scan, or a post-ready task; heavy imports stay lazy or get a `warmup_prefetch` daemon thread; routes answer a graceful 503/None while their subsystem warms. **Enforced fail-closed by the pre-push BOOT BUDGET gate** (`scripts/ci/check_boot_budget.py`: one real cold boot; window ≤ 8 s, voice-usable + app-interactive ≤ 20 s). Doctrine + how-to: `docs/diagnostics/BOOT-TTU-NOTES.md` |---diff --git a/scripts/ci/check_boot_budget.py b/scripts/ci/check_boot_budget.pyindex 8b8589bd6c..dbe67e73f8 100644--- a/scripts/ci/check_boot_budget.py+++ b/scripts/ci/check_boot_budget.py@@ -51,6 +51,10 @@ SKIP_EXIT = 78 # EX_CONFIG-ish: "could not measure" — neutral, not a failureDEFAULT_WINDOW_BUDGET_MS = 8_000.0DEFAULT_VOICE_BUDGET_MS = 20_000.0+# APP_INTERACTIVE = set_app hands the UI's held data requests to the real app+# (the user-facing "usable" moment; measured median 5.3 s isolated). Checked in+# voice mode (the run must live past the window anchor to see it).+DEFAULT_INTERACTIVE_BUDGET_MS = 20_000.0def _audio_capable() -> bool:@@ -71,6 +75,11 @@ def main() -> int:voice_budget = float(os.environ.get("JARVIS_BOOT_BUDGET_VOICE_MS", DEFAULT_VOICE_BUDGET_MS))+ interactive_budget = float(+ os.environ.get(+ "JARVIS_BOOT_BUDGET_INTERACTIVE_MS", DEFAULT_INTERACTIVE_BUDGET_MS+ )+ )if not HARNESS.exists():print(f"boot-budget: harness missing ({HARNESS}) — skipping", flush=True)return SKIP_EXIT@@ -125,6 +134,20 @@ def main() -> int:f"{voice_budget:.0f} ms OK",flush=True,)+ interactive_ms = summary.get("median_app_interactive_wall_ms")+ if interactive_ms is None:+ failures.append("APP_INTERACTIVE anchor missing from harness output")+ elif interactive_ms > interactive_budget:+ failures.append(+ f"app-interactive {interactive_ms:.0f} ms > budget "+ f"{interactive_budget:.0f} ms"+ )+ else:+ print(+ f"boot-budget: app-interactive {interactive_ms:.0f} ms <= "+ f"{interactive_budget:.0f} ms OK",+ flush=True,+ )else:print("boot-budget: no audio input device — voice anchor skipped (honest)", flush=True)