Skip to content

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.

feat(identity): move every technical name to Dodaios with a lossless migration (#750)

Ruben Lütke0c65b2bd2f14
diff --git a/.env.example b/.env.example
index 862b1d8eef..891b5834cd 100644
--- a/.env.example
+++ b/.env.example
@@ -8,7 +8,8 @@
# committed file.
#
# Secret resolution order (dodaios/core/config.py:get_secret):
-# 1. OS credential manager (keyring, service "personal-jarvis")
+# 1. OS credential manager (keyring, service "dodaios"; keys saved before the
+# rename are still read from "personal-jarvis")
# 2. environment variable
# 3. this .env file (dev fallback only)
#
diff --git a/.github/workflows/desktop-installers.yml b/.github/workflows/desktop-installers.yml
index f921865fb1..5262bfa74a 100644
--- a/.github/workflows/desktop-installers.yml
+++ b/.github/workflows/desktop-installers.yml
@@ -5,11 +5,20 @@
# https://github.com/Dodaios/Dodaios/releases/latest/download/<name>,
# so the asset names below are a contract, not a convention.
#
-# PersonalJarvis-Setup-x64.exe Windows 10/11 x64, per-user Inno wizard
-# PersonalJarvis-macOS-arm64.dmg Apple Silicon
-# PersonalJarvis-macOS-x64.dmg Intel Mac
-# PersonalJarvis-Linux-x86_64.AppImage Linux x86_64
-# installers-SHA256SUMS.txt what the updater verifies against
+# Dodaios-Setup-x64.exe Windows 10/11 x64, per-user Inno wizard
+# Dodaios-macOS-arm64.dmg Apple Silicon
+# Dodaios-macOS-x64.dmg Intel Mac
+# Dodaios-Linux-x86_64.AppImage Linux x86_64
+# installers-SHA256SUMS.txt what the updater verifies against
+#
+# Every installer is ALSO published under its earlier name
+# (PersonalJarvis-Setup-x64.exe, PersonalJarvis-macOS-<arch>.dmg,
+# PersonalJarvis-Linux-x86_64.AppImage) with identical bytes: installs frozen
+# before the rename only look for that name. The release job makes the copies
+# after signing (scripts/ci/installer_aliases.py) and the checksum manifest
+# lists both names. The Windows setup is built and signed under the earlier
+# name, because the SignPath artifact configuration pins it
+# (docs/code-signing-policy.md); its current name is the copy.
#
# Each OS job runs the SAME script a maintainer runs locally
# (packaging/<os>/build.*), so a green run here means the documented command
@@ -142,7 +151,7 @@ jobs:
run: pwsh packaging/windows/build.ps1
- name: Verify frozen browser provisioning and restart
- run: python scripts/ci/check_frozen_browser.py --executable dist/Jarvis/PersonalJarvis.exe --output frozen-browser-proof
+ run: python scripts/ci/check_frozen_browser.py --executable dist/Jarvis/DodaiosApp.exe --output frozen-browser-proof
- name: Preserve frozen browser evidence
if: always()
@@ -248,6 +257,8 @@ jobs:
run: |
echo "::notice::Neither SignPath (SIGNPATH_API_TOKEN + SIGNPATH_ORGANIZATION_ID/PROJECT_SLUG/SIGNING_POLICY_SLUG) nor AZURE_* signing is configured - the installer is UNSIGNED."
+ # The signed setup under the name SignPath pins; the release job adds the
+ # byte-identical Dodaios-Setup-x64.exe.
- name: Upload the installer
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
@@ -346,7 +357,7 @@ jobs:
# headless smoke test below, so look at the built app itself (BUG-222).
- name: Verify the app bundle can use macOS permissions
shell: bash
- run: python scripts/ci/check_frozen_macos_app.py --app "dist/Personal Jarvis.app"
+ run: python scripts/ci/check_frozen_macos_app.py --app "dist/Dodaios.app"
- name: Remove signing credentials even after a failed build
if: always() && env.HAS_APPLE_SIGNING == 'true'
@@ -379,9 +390,9 @@ jobs:
set -euo pipefail
mount_point="${RUNNER_TEMP}/jarvis-browser-dmg"
mkdir -p "$mount_point"
- hdiutil attach "dist/installers/PersonalJarvis-macOS-${{ matrix.arch }}.dmg" -readonly -nobrowse -mountpoint "$mount_point"
+ hdiutil attach "dist/installers/Dodaios-macOS-${{ matrix.arch }}.dmg" -readonly -nobrowse -mountpoint "$mount_point"
trap 'hdiutil detach "$mount_point"' EXIT
- python scripts/ci/check_frozen_browser.py --executable "$mount_point/Personal Jarvis.app/Contents/MacOS/PersonalJarvis" --output frozen-browser-proof
+ python scripts/ci/check_frozen_browser.py --executable "$mount_point/Dodaios.app/Contents/MacOS/DodaiosApp" --output frozen-browser-proof
- name: Preserve frozen browser evidence
if: always()
@@ -398,7 +409,7 @@ jobs:
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: installer-macos-${{ matrix.arch }}
- path: dist/installers/PersonalJarvis-macOS-${{ matrix.arch }}.dmg
+ path: dist/installers/Dodaios-macOS-${{ matrix.arch }}.dmg
if-no-files-found: error
retention-days: 14
@@ -462,7 +473,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
- dist/installers/PersonalJarvis-Linux-x86_64.AppImage --appimage-extract > /dev/null
+ dist/installers/Dodaios-Linux-x86_64.AppImage --appimage-extract > /dev/null
python scripts/ci/check_frozen_browser.py --executable squashfs-root/AppRun --output frozen-browser-proof
- name: Preserve frozen browser evidence
@@ -481,8 +492,8 @@ jobs:
with:
name: installer-linux-x86_64
path: |
- dist/installers/PersonalJarvis-Linux-x86_64.AppImage
- dist/installers/personal-jarvis_*_amd64.deb
+ dist/installers/Dodaios-Linux-x86_64.AppImage
+ dist/installers/*_amd64.deb
if-no-files-found: error
retention-days: 14
@@ -536,6 +547,10 @@ jobs:
path: installers
merge-multiple: true
+ # After signing, on purpose: both names must carry the signed bytes.
+ - name: Publish every installer under both of its names
+ run: python scripts/ci/installer_aliases.py installers
+
- name: Write installers-SHA256SUMS.txt
shell: bash
run: |
@@ -545,6 +560,10 @@ jobs:
# Every asset the download page and the updater promise must be here.
# A silently missing DMG would ship a release that only half works.
required=(
+ Dodaios-Setup-x64.exe
+ Dodaios-macOS-arm64.dmg
+ Dodaios-macOS-x64.dmg
+ Dodaios-Linux-x86_64.AppImage
PersonalJarvis-Setup-x64.exe
PersonalJarvis-macOS-arm64.dmg
PersonalJarvis-macOS-x64.dmg
@@ -559,7 +578,7 @@ jobs:
# Flat names only: the updater looks each asset up by its file name.
rm -f installers-SHA256SUMS.txt
sha256sum "${required[@]}" > installers-SHA256SUMS.txt
- for optional in personal-jarvis_*_amd64.deb; do
+ for optional in dodaios_*_amd64.deb personal-jarvis_*_amd64.deb; do
[ -e "$optional" ] || continue
sha256sum "$optional" >> installers-SHA256SUMS.txt
done
@@ -575,7 +594,7 @@ jobs:
retention-days: 14
# SLSA build provenance for every native installer the manifest lists
- # (.exe, both .dmg, .AppImage, .deb), signed with this workflow's OIDC
+ # (.exe, both .dmg, .AppImage, .deb, under both names), signed with this workflow's OIDC
# identity and stored in GitHub's attestation store. It runs before the
# upload so a release can never carry installers without provenance, and
# it attests the final (signed) bytes that the OS jobs uploaded.
diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml
index c5dab5c68d..27e6554346 100644
--- a/.github/workflows/release-cut.yml
+++ b/.github/workflows/release-cut.yml
@@ -13,7 +13,8 @@
# installers, signed installer) run on it. Each of them starts with
# release-gate.yml, which waits for CI on the release commit.
# 5. publishes the GitHub Release with the notes and the resumable
-# personal-jarvis-src.tar.gz asset the install scripts fall back to. The
+# dodaios-src.tar.gz and personal-jarvis-src.tar.gz assets the install
+# scripts fall back to (current name first). The
# in-app updater follows releases/latest, so this is the step that reaches
# users.
# 6. runs release-smoke.yml against the published release (read-only).
diff --git a/.github/workflows/release-smoke.yml b/.github/workflows/release-smoke.yml
index 98cb382cd8..92032cd69a 100644
--- a/.github/workflows/release-smoke.yml
+++ b/.github/workflows/release-smoke.yml
@@ -142,29 +142,33 @@ jobs:
run: |
set -euo pipefail
cd "$RUNNER_TEMP/installers"
- for deb in personal-jarvis_*_amd64.deb; do
+ for deb in dodaios_*_amd64.deb personal-jarvis_*_amd64.deb; do
[ -e "$deb" ] || continue
dpkg-deb --info "$deb" > /dev/null
echo "$deb: package metadata OK"
done
# An AppImage is an executable ELF runtime with the squashfs appended.
+ # Both names are the same file; each is checked as users download it.
python - <<'PYEOF'
import sys
- with open("PersonalJarvis-Linux-x86_64.AppImage", "rb") as stream:
- if stream.read(4) != b"\x7fELF":
- sys.exit("::error::PersonalJarvis-Linux-x86_64.AppImage is not an ELF executable")
- print("PersonalJarvis-Linux-x86_64.AppImage: ELF runtime OK")
+ for name in ("Dodaios-Linux-x86_64.AppImage", "PersonalJarvis-Linux-x86_64.AppImage"):
+ with open(name, "rb") as stream:
+ if stream.read(4) != b"\x7fELF":
+ sys.exit(f"::error::{name} is not an ELF executable")
+ print(f"{name}: ELF runtime OK")
PYEOF
- name: Inspect the Windows installer signature
if: matrix.platform == 'windows'
shell: pwsh
run: |
- $installer = Join-Path $env:RUNNER_TEMP 'installers\PersonalJarvis-Setup-x64.exe'
- $signature = Get-AuthenticodeSignature -FilePath $installer
- Write-Host "Authenticode: $($signature.Status) $($signature.SignerCertificate.Subject)"
- if ($signature.Status -ne 'Valid') {
- Write-Host "::notice::PersonalJarvis-Setup-x64.exe Authenticode status: $($signature.Status)"
+ foreach ($name in @('Dodaios-Setup-x64.exe', 'PersonalJarvis-Setup-x64.exe')) {
+ $installer = Join-Path $env:RUNNER_TEMP "installers\$name"
+ $signature = Get-AuthenticodeSignature -FilePath $installer
+ Write-Host "${name} Authenticode: $($signature.Status) $($signature.SignerCertificate.Subject)"
+ if ($signature.Status -ne 'Valid') {
+ Write-Host "::notice::$name Authenticode status: $($signature.Status)"
+ }
}
- name: Inspect the macOS disk images
@@ -173,7 +177,7 @@ jobs:
run: |
set -euo pipefail
cd "$RUNNER_TEMP/installers"
- for dmg in PersonalJarvis-macOS-arm64.dmg PersonalJarvis-macOS-x64.dmg; do
+ for dmg in Dodaios-macOS-arm64.dmg Dodaios-macOS-x64.dmg PersonalJarvis-macOS-arm64.dmg PersonalJarvis-macOS-x64.dmg; do
hdiutil verify "$dmg"
if ! spctl --assess --type open --context context:primary-signature -v "$dmg" 2>&1; then
echo "::notice::$dmg is not accepted by Gatekeeper (unsigned or not notarized)"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b8bd8caaba..2c220f82b9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,17 +1,24 @@
-# Publish Personal Jarvis to PyPI on every `v*` tag.
+# Publish Dodaios to PyPI on every `v*` tag.
#
# No API token and no repository secret is involved: PyPI's Trusted Publishing
# mints a short-lived, single-use credential from this workflow's OIDC identity.
# That identity is (owner, repository, workflow FILE NAME, environment), so the
-# five values below must match the publisher registered on PyPI exactly —
-# renaming this file or the environment silently breaks every future release:
+# values below must match the publisher registered on PyPI exactly — renaming
+# this file or the environment silently breaks every future release:
#
-# PyPI project personal-jarvis
+# PyPI projects dodaios, personal-jarvis (both trust the same publisher)
# Owner Dodaios
# Repository Dodaios
# Workflow release.yml
# Environment pypi
#
+# Two projects, one code base: the distribution is `dodaios` now, and every
+# release also publishes the same wheel and sdist as `personal-jarvis`, its
+# earlier name, so `pip install -U personal-jarvis` keeps updating until those
+# installs have moved (scripts/ci/build_distributions.py). Both own the same
+# package files, which is why install/installer.py removes `personal-jarvis`
+# before it installs `dodaios`.
+#
# The build and the publish are two jobs on purpose. Only the tiny publish job
# holds `id-token: write` and enters the `pypi` environment, so the OIDC token
# is never reachable from the step that executes project code.
@@ -109,15 +116,16 @@ jobs:
- name: Verify the README has no repo-relative URLs
run: python scripts/ci/check_readme_absolute_urls.py README.md
+ # dist/dodaios/ and dist/personal-jarvis/: one wheel and one sdist each.
- name: Build
- run: python -m build --no-isolation
+ run: python scripts/ci/build_distributions.py --outdir dist
# Metadata only. Do NOT read this as "the README was checked": twine maps
# `text/markdown` to no renderer at all ("Rendering cannot fail"), so a
# Markdown long_description is never rendered here and always passes. The
# README's real failure mode is covered by the URL gate above instead.
- name: Check the packaging metadata
- run: python -m twine check --strict dist/*
+ run: python -m twine check --strict dist/*/*
- name: Upload the artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
@@ -144,5 +152,17 @@ jobs:
name: dist
path: dist/
- - name: Publish
+ # The established project first: existing installs update from it. A
+ # re-run after a partial upload skips the files PyPI already holds
+ # (released files are immutable, so they are the ones this tag built).
+ - name: Publish personal-jarvis (earlier name)
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
+ with:
+ packages-dir: dist/personal-jarvis/
+ skip-existing: true
+
+ - name: Publish dodaios
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
+ with:
+ packages-dir: dist/dodaios/
+ skip-existing: true
diff --git a/.gitignore b/.gitignore
index ec9d9a4791..6a4c02f0df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ boot-baseline.json
# Config-Drift-Guard temp backups (never commit)
jarvis.toml.tmp
+dodaios.toml.tmp
*.toml.tmp
*.key
secrets/
@@ -56,6 +57,7 @@ dodaios/ui/web/.frontend-*
# time to opt a checkout into in-app self-update. Must NEVER be committed — a
# manual clone or a dev tree must not look like a managed install (else the
# in-app updater could git-reset --hard it). See dodaios/ui/web/update_routes.py.
+.dodaios-managed-install
.jarvis-managed-install
# Atomic in-app update handoff/result files. They are local lifecycle state and
# must never make a source checkout look like an update is pending.
@@ -240,9 +242,14 @@ git-worktree-status.csv
# Downloads/Open-Source-Privacy-Separation.md for the full plan.
# ============================================================
-# Personal config instance — ship jarvis.toml.example instead. Jarvis already
-# boots with NO jarvis.toml (pure Pydantic defaults, core/config.py).
+# Personal config instance — ship jarvis.toml.example instead. The app already
+# boots with no config file (pure Pydantic defaults, core/config.py). An install
+# keeps a jarvis.toml it has; a new one writes dodaios.toml. The config writer's
+# unique tempfiles sit beside either.
/jarvis.toml
+/dodaios.toml
+/.jarvis.toml.*.tmp
+/.dodaios.toml.*.tmp
# Per-user MCP server config — ship mcp.json.example instead.
/mcp.json
diff --git a/Dockerfile b/Dockerfile
index fa3cc0fd00..d72c9340c8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.7
#
-# Personal Jarvis — headless server image (the cloud-first / VPS path).
+# Dodaios — headless server image (the cloud-first / VPS path).
#
# Boots the FastAPI + WebSocket backend and serves the prebuilt browser UI, so a
# user reaches the full Router-Brain experience through any browser without a
@@ -8,15 +8,19 @@
# are opt-in and useless in a headless container (see AGENTS.md, cloud-first
# doctrine). Bring your own provider keys via environment variables.
#
-# docker build -t personal-jarvis .
+# docker build -t dodaios .
# docker run --rm -p 127.0.0.1:8000:8000 \
# -v jarvis-data:/app/data \
# -e JARVIS_CONTROL_API_KEY=jctl_change_me \
# -e ANTHROPIC_API_KEY=sk-ant-... \
-# personal-jarvis
+# dodaios
# # then open http://localhost:8000
#
# Or use the bundled docker-compose.yml.
+#
+# The volume keeps its earlier name `jarvis-data` and the configuration stays
+# at /app/data/jarvis.toml: a container started from this image reads the data
+# and settings an earlier image left in that volume.
# --- Stage 1: build the React UI ---------------------------------------------
# The frontend source lives in the repo; build it once here so the runtime image
@@ -76,6 +80,11 @@ USER jarvis
EXPOSE 8000
+LABEL org.opencontainers.image.title="Dodaios" \
+ org.opencontainers.image.description="Dodaios headless server: the API and the browser interface" \
+ org.opencontainers.image.source="https://github.com/Dodaios/Dodaios" \
+ org.opencontainers.image.licenses="Apache-2.0"
+
# JARVIS_BIND_HOST=0.0.0.0 makes the headless listener reachable through the
# published port (the control key is the security boundary — see compose).
# JARVIS_NONINTERACTIVE skips the first-run wizard; keys come from the env.
diff --git a/docker-compose.yml b/docker-compose.yml
index 073168c97e..4ae88c34bc 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,4 +1,4 @@
-# Personal Jarvis — headless server, the cloud-first / VPS path.
+# Dodaios — headless server, the cloud-first / VPS path.
#
# docker compose up --build # build the image and start the server
# # then open http://localhost:8000
@@ -7,9 +7,12 @@
# (compose loads it automatically). Nothing is bundled.
services:
+ # The service and the volume keep their earlier names: renaming the service
+ # would orphan a running container, and renaming the volume would start an
+ # existing deployment with no data or settings.
jarvis:
build: .
- image: personal-jarvis:local
+ image: dodaios:local
# Bind to the host loopback only — the published port is NOT exposed to the
# LAN. The Control-API key is the security boundary on the container's
# 0.0.0.0 bind (JARVIS_BIND_HOST in the image).
diff --git a/docs/LLM-CONTEXT.md b/docs/LLM-CONTEXT.md
index f4dce90cbb..2ca9f6b345 100644
--- a/docs/LLM-CONTEXT.md
+++ b/docs/LLM-CONTEXT.md
@@ -156,8 +156,8 @@ on a real macOS box and a real Linux desktop to convert each row to a dated
**Manual install (works everywhere):**
```bash
-git clone https://github.com/Dodaios/Dodaios ~/.personal-jarvis
-cd ~/.personal-jarvis
+git clone https://github.com/Dodaios/Dodaios ~/.dodaios
+cd ~/.dodaios
python -m venv .venv
source .venv/bin/activate # Windows: .\.venv\Scripts\Activate.ps1
pip install -e . --no-deps # activates entry_points (BUG-006/014 recovery)
diff --git a/docs/architecture-overview.md b/docs/architecture-overview.md
index 25453fa38e..338c8793db 100644
--- a/docs/architecture-overview.md
+++ b/docs/architecture-overview.md
@@ -106,7 +106,7 @@ All `Brain`, `STT`, `TTS`, `Harness` provider methods return `AsyncIterator[...]
### Secrets
-Access via `dodaios.core.config.get_secret(key, env_fallback)` only. Hierarchy: OS credential store (keyring, service `personal-jarvis`) → ENV → `.env` (dev fallback) → local-file fallback (`config._ensure_keyring_backend`, 0600 JSON, headless hosts with no Secret Service). The wizard (`dodaios/setup/wizard.py`) populates the store. **Never** put API keys in code, `jarvis.toml`, commits, or `.claude/` files. Voice/chat must never accept secrets (AP-2 — STT log leak vector).
+Access via `dodaios.core.config.get_secret(key, env_fallback)` only. Hierarchy: OS credential store (keyring, service `dodaios`, with the earlier `personal-jarvis` read as a fallback) → ENV → `.env` (dev fallback) → local-file fallback (`config._ensure_keyring_backend`, 0600 JSON, headless hosts with no Secret Service). The wizard (`dodaios/setup/wizard.py`) populates the store. **Never** put API keys in code, `jarvis.toml`, commits, or `.claude/` files. Voice/chat must never accept secrets (AP-2 — STT log leak vector).
### Brain providers + ack-brain
diff --git a/docs/ci-pipeline.md b/docs/ci-pipeline.md
index 35aef2f8c2..57e7a70e37 100644
--- a/docs/ci-pipeline.md
+++ b/docs/ci-pipeline.md
@@ -447,8 +447,9 @@ A release happens **only** when the maintainer asks for one.
while CI still runs). A separate main run cannot replace this tag's evidence.
Tag CI is excluded from branch-run cancellation. The checkout, tag and SHA must identify the same commit;
failure to fetch main cannot fall back to stale ancestry.
-* The GitHub Release (notes + the resumable `personal-jarvis-src.tar.gz`) is
- staged as a draft. `release_assets.py` waits for all three publishers and
+* The GitHub Release (notes + the resumable source archive, published as
+ `dodaios-src.tar.gz` and as `personal-jarvis-src.tar.gz` for installers from
+ before the rename) is staged as a draft. `release_assets.py` waits for all three publishers and
verifies each actual publication job in its latest attempt; workflow success
with a skipped publication job is insufficient. It
verifies required assets and GitHub's stored digests against both checksum
@@ -469,13 +470,32 @@ A release happens **only** when the maintainer asks for one.
Re-run failed jobs with their original build artifacts to recover a partial
upload; a full rebuild with different bytes requires an explicit decision.
The in-app updater follows `releases/latest`; draft releases remain hidden.
+* **Two names per installer.** Every native installer is published as
+ `Dodaios-*` and, with identical bytes, under its earlier `PersonalJarvis-*`
+ name, the only one installs from before the rename look for. The macOS and
+ Linux builds produce the `Dodaios-*` file; the Windows setup is built and
+ signed as `PersonalJarvis-Setup-x64.exe`, because the SignPath artifact
+ configuration pins that name (docs/code-signing-policy.md). After signing,
+ the release job copies each file to its other name
+ (`scripts/ci/installer_aliases.py`), `installers-SHA256SUMS.txt` lists both,
+ and finalization refuses a release whose two names of one installer differ.
+* **Two names on PyPI.** `release.yml` builds the wheel and sdist as `dodaios`
+ and again as `personal-jarvis`, the earlier name, from a copy of
+ `pyproject.toml` that differs only in the names
+ (`scripts/ci/build_distributions.py`), and publishes `personal-jarvis` first,
+ then `dodaios`. Both projects trust the same publisher (this repository,
+ `release.yml`, environment `pypi`). The two distributions own the same
+ files, so `install/installer.py` uninstalls `personal-jarvis` before it
+ installs the checkout, and the app logs one warning when an environment
+ holds both.
* **Build provenance.** On a tag, `desktop-installers.yml` attests every
native installer listed in `installers-SHA256SUMS.txt` (`.exe`, both
- `.dmg`, `.AppImage`, `.deb`) with `actions/attest-build-provenance` before
- the upload. Anyone can check a download:
+ `.dmg`, `.AppImage`, `.deb`, under both names) with
+ `actions/attest-build-provenance` before the upload. Anyone can check a
+ download:
```bash
- gh attestation verify PersonalJarvis-Setup-x64.exe -R Dodaios/Dodaios
+ gh attestation verify Dodaios-Setup-x64.exe -R Dodaios/Dodaios
```
Releases up to and including v2.9.0 predate this and have no attestation.
diff --git a/docs/code-signing-policy.md b/docs/code-signing-policy.md
index be8cfdc278..ead6914b3f 100644
--- a/docs/code-signing-policy.md
+++ b/docs/code-signing-policy.md
@@ -15,6 +15,11 @@ Free code signing provided by [SignPath.io](https://signpath.io), certificate by
| --- | --- | --- |
| `PersonalJarvis-Setup-x64.exe` | Windows 10/11 x64 | SignPath Foundation certificate, via SignPath.io |
+The setup is signed under that name because the artifact configuration below
+pins it. After signing, the release publishes the same signed file a second
+time as `Dodaios-Setup-x64.exe`; the two downloads are byte-identical, so both
+carry this signature.
+
Only files built from this repository's source code by the
[`Desktop installers`](../.github/workflows/desktop-installers.yml) GitHub Actions
workflow are submitted for signing. The workflow runs on GitHub-hosted runners
diff --git a/docs/desktop-installers.md b/docs/desktop-installers.md
index 74da2d790b..dc6d017af1 100644
--- a/docs/desktop-installers.md
+++ b/docs/desktop-installers.md
@@ -16,12 +16,20 @@ contract - the website's download button and the in-app updater both resolve
| Asset | Platform |
| -------------------------------------- | ----------------------------------------- |
-| `PersonalJarvis-Setup-x64.exe` | Windows 10/11 x64, per-user Inno Setup |
-| `PersonalJarvis-macOS-arm64.dmg` | Apple Silicon |
-| `PersonalJarvis-macOS-x64.dmg` | Intel Mac |
-| `PersonalJarvis-Linux-x86_64.AppImage` | Linux x86_64 |
+| `Dodaios-Setup-x64.exe` | Windows 10/11 x64, per-user Inno Setup |
+| `Dodaios-macOS-arm64.dmg` | Apple Silicon |
+| `Dodaios-macOS-x64.dmg` | Intel Mac |
+| `Dodaios-Linux-x86_64.AppImage` | Linux x86_64 |
| `installers-SHA256SUMS.txt` | what the updater verifies every download against |
+Every installer is published a second time, with identical bytes, under its
+earlier name (`PersonalJarvis-Setup-x64.exe`, `PersonalJarvis-macOS-arm64.dmg`,
+`PersonalJarvis-macOS-x64.dmg`, `PersonalJarvis-Linux-x86_64.AppImage`):
+installs from before the rename only look for those. The checksum manifest
+lists both names. The Windows setup is signed under its earlier name, which
+the SignPath configuration pins, and copied to `Dodaios-Setup-x64.exe` after
+signing (`scripts/ci/installer_aliases.py`).
+
The terminal one-liner and `pipx install personal-jarvis` stay supported. They
produce a *managed* or *dev* install, which updates through git - see
[section 6](#6-how-an-installed-copy-updates-itself).
@@ -122,7 +130,7 @@ The wizard itself is `packaging/windows/PersonalJarvis.iss`:
```bash
./packaging/macos/build.sh
-# -> dist/installers/PersonalJarvis-macOS-<arm64|x64>.dmg
+# -> dist/installers/Dodaios-macOS-<arm64|x64>.dmg
```
Owned by `packaging/macos/`. It reads `APPLE_CERTIFICATE_P12_BASE64` and
@@ -191,7 +199,7 @@ own grants.
```bash
./packaging/linux/build.sh
-# -> dist/installers/PersonalJarvis-Linux-x86_64.AppImage
+# -> dist/installers/Dodaios-Linux-x86_64.AppImage
```
Owned by `packaging/linux/`. Built on the oldest supported runner
@@ -285,9 +293,10 @@ For a frozen install (`dodaios/core/installer_update.py`):
1. **Pick the asset.** OS plus CPU architecture map to one row of
`INSTALLER_ASSET_NAMES` in `dodaios/core/installer_update.py`: the name from
- the table in section 1, and the same file under the `Dodaios-` prefix. The
- updater takes the first accepted name a release carries; when a release
- carries more than one, the first that `installers-SHA256SUMS.txt` lists. No
+ the table in section 1, and the same file under its earlier
+ `PersonalJarvis-` name. The updater takes the first accepted name a release
+ carries; when a release carries more than one, the first that
+ `installers-SHA256SUMS.txt` lists. No
mapping (Windows on ARM, Linux on aarch64) means the button never appears.
2. **Refuse to offer what cannot be installed.** `status` reports
`update_available: true` only when the release actually carries both this
diff --git a/docs/os-parity.md b/docs/os-parity.md
index d6363dc1db..a31d98faf4 100644
--- a/docs/os-parity.md
+++ b/docs/os-parity.md
@@ -1,5 +1,21 @@
# OS Feature Parity — macOS / Linux Gap Register
+## Credential service renamed to `dodaios` (2026-10-19, T3)
+
+New keys are saved under the credential service `dodaios` on every OS (Windows
+Credential Manager, macOS Keychain, Secret Service, and the 0600 file store a
+headless host uses). A key saved under the earlier `personal-jarvis` service
+is still read when `dodaios` holds nothing for that slot, with the same
+precedence over environment variables as before; deleting a key clears both
+services, and saving a key refreshes a `personal-jarvis` entry only where one
+already exists. The main instance copies the legacy entries once in a
+background thread after start-up and records a `__migrated_from__personal-jarvis`
+marker; on macOS the single vault item is copied in one write, so no prompt
+appears per key. The uninstaller removes both services, the marker and, on
+macOS, both vault items. Covered on every OS shape by fake-keyring tests
+(`test_keyring_service_rename.py`, `test_identity_credentials.py`,
+`test_uninstall.py`); no real OS credential store was exercised.
+
## PATH length budget (issue #574, T2)
On Windows the app keeps its own `PATH` within 31,000 characters: past the
@@ -1330,9 +1346,9 @@ verifies against before it replaces anything.
| OS | Artifact | Built by | Native window | Signing | Shell registration | Where it has actually run |
|---|---|---|---|---|---|---|
-| Windows 10/11 x64 | `PersonalJarvis-Setup-x64.exe` (Inno Setup, per-user, no admin prompt, fixed AppId for in-place upgrades) | `packaging/windows/build.ps1` | Yes — WebView2, the shipping desktop window | Owned by the Windows packaging work; see `packaging/windows/` | The installer creates and removes the Start-Menu / Desktop entries | Owned by the Windows packaging work — not verified from here |
-| macOS 12+, arm64 and x64 | `PersonalJarvis-macOS-arm64.dmg`, `PersonalJarvis-macOS-x64.dmg` (`Personal Jarvis.app` + an `/Applications` symlink) | `packaging/macos/build.sh` | Yes — WKWebView through pywebview | Developer ID + Hardened Runtime + notarization when `APPLE_SIGNING_IDENTITY`/`APPLE_ID`/`APPLE_TEAM_ID`/`APPLE_APP_SPECIFIC_PASSWORD` are set; ad-hoc signing and a printed notice otherwise (as of v2.5.0 every published image is the ad-hoc one; the certificate itself comes from the `APPLE_CERTIFICATE_P12_BASE64` / `APPLE_CERTIFICATE_PASSWORD` secrets, which `build.sh` imports into a temporary keychain) | The user drags the app to `/Applications`; the app registers nothing | The ad-hoc path runs for real on the macOS runners (every published image comes from it). The signed/notarized path has **never run**: only `bash -n`, ShellCheck 0.11.0 `-S style` (zero findings), a `DRY_RUN=1` rehearsal of both paths and the certificate import against a stand-in `security` command. A Mac with the Apple secrets is the outstanding gate |
-| Linux x86_64 | `PersonalJarvis-Linux-x86_64.AppImage`, `personal-jarvis_<version>_amd64.deb` | `packaging/linux/build.sh` | **No** — serves its interface over loopback HTTP and opens the default browser (P-38) | None. AppImage has no signing story in this project; the release's SHA-256 sums are the integrity check | `.deb` installs a `.desktop` entry, the hicolor icon, `/usr/bin/jarvis` and `/usr/bin/personal-jarvis`. The AppImage carries its `.desktop` inside itself for AppImageLauncher/`appimaged` | Full build proven in a `python:3.12-bookworm` container on 2026-08-25 (~2 min, 156 MB AppImage + 172 MB `.deb`): `appimagetool` digest check, `desktop-file-validate`, both executables out of one freeze, `--version` through the packaged AppImage and through `AppRun`, `AppRun serve` answering `/api/health` in 1-3 s, and the browser hand-off calling the opener with the right URL. Not run on a real desktop distribution or with FUSE |
+| Windows 10/11 x64 | `Dodaios-Setup-x64.exe`, published with identical bytes as `PersonalJarvis-Setup-x64.exe` too, the name the build signs under because SignPath pins it (Inno Setup, per-user, no admin prompt, fixed AppId for in-place upgrades) | `packaging/windows/build.ps1`, `scripts/ci/installer_aliases.py` | Yes — WebView2, the shipping desktop window | Owned by the Windows packaging work; see `packaging/windows/` | The installer creates and removes the Start-Menu / Desktop entries | Owned by the Windows packaging work — not verified from here |
+| macOS 12+, arm64 and x64 | `Dodaios-macOS-arm64.dmg`, `Dodaios-macOS-x64.dmg`, published with identical bytes under the earlier `PersonalJarvis-macOS-<arch>.dmg` names too (`Personal Jarvis.app` + an `/Applications` symlink) | `packaging/macos/build.sh` | Yes — WKWebView through pywebview | Developer ID + Hardened Runtime + notarization when `APPLE_SIGNING_IDENTITY`/`APPLE_ID`/`APPLE_TEAM_ID`/`APPLE_APP_SPECIFIC_PASSWORD` are set; ad-hoc signing and a printed notice otherwise (as of v2.5.0 every published image is the ad-hoc one; the certificate itself comes from the `APPLE_CERTIFICATE_P12_BASE64` / `APPLE_CERTIFICATE_PASSWORD` secrets, which `build.sh` imports into a temporary keychain) | The user drags the app to `/Applications`; the app registers nothing | The ad-hoc path runs for real on the macOS runners (every published image comes from it). The signed/notarized path has **never run**: only `bash -n`, ShellCheck 0.11.0 `-S style` (zero findings), a `DRY_RUN=1` rehearsal of both paths and the certificate import against a stand-in `security` command. A Mac with the Apple secrets is the outstanding gate |
+| Linux x86_64 | `Dodaios-Linux-x86_64.AppImage` (published with identical bytes as `PersonalJarvis-Linux-x86_64.AppImage` too), `personal-jarvis_<version>_amd64.deb` | `packaging/linux/build.sh` | **No** — serves its interface over loopback HTTP and opens the default browser (P-38) | None. AppImage has no signing story in this project; the release's SHA-256 sums are the integrity check | `.deb` installs a `.desktop` entry, the hicolor icon, `/usr/bin/jarvis` and `/usr/bin/personal-jarvis`. The AppImage carries its `.desktop` inside itself for AppImageLauncher/`appimaged` | Full build proven in a `python:3.12-bookworm` container on 2026-08-25 (~2 min, 156 MB AppImage + 172 MB `.deb`): `appimagetool` digest check, `desktop-file-validate`, both executables out of one freeze, `--version` through the packaged AppImage and through `AppRun`, `AppRun serve` answering `/api/health` in 1-3 s, and the browser hand-off calling the opener with the right URL. Not run on a real desktop distribution or with FUSE |
**Frozen builds register nothing themselves.** For a native install the
installer owns every shell artifact, so `dodaios/setup/desktop_integration.py`
@@ -1430,6 +1446,8 @@ macOS restart through a renamed bundle run only against fakes.
| P-42 | High | Outbound sockets (every lane) | Every connection borrows an ephemeral port from a pool the OS owns, and a closed one keeps that port through TIME_WAIT. The ceiling and the linger differ per OS, and so does what gives out first: **Windows** 16 384 ports / 120 s — the tightest by far, and the port pool is what empties, which stops EVERY process on the machine from connecting (the desktop appears frozen, then heals itself when TIME_WAIT expires); **Linux** 28 232 ports / 60 s, but `RLIMIT_NOFILE` is normally the tighter of the two (1024 on a stock `python:3.11-slim`), so the backend dies of EMFILE while the desktop around it is fine; **macOS** 16 384 ports / 15 s, so it recovers fastest. BUG-215 was the Windows shape: an unjittered wake storm (one socket per pane, per window, per instance, all on one `visibilitychange`) on top of a standing per-call-client burn. The rule that follows is to cap the burst, never to widen a limit — code that fits the Windows budget fits everywhere | `dodaios/ui/web/frontend/src/lib/connectBudget.ts` (`jitteredDelay`, `spreadDelay`, `requestConnect`), `dodaios/core/http_pool.py` (`HttpClientPool`, `SyncHttpClientPool`, `default_limits`), `dodaios/core/socket_budget.py` (`read_platform_limits`, `take_census`, `SocketBudgetWatchdog`), `dodaios/realtime/local_server/supervisor.py::_port_open` (`SO_LINGER`) | Identical on all three: one shared connect budget in the frontend, pooled keep-alive clients in Python, and a watchdog armed by BOTH entry points (desktop shell and `--headless`) that reads the ceiling per platform — `netsh` on Windows (parsed as integers, because it translates its own field names), `/proc/sys/net/ipv4/ip_local_port_range` plus `RLIMIT_NOFILE` on Linux, `sysctl net.inet.ip.portrange.*` on macOS. A host that answers none of them falls back to the documented default and says the number was assumed; a host with no ceiling at all logs one line and throttles nothing, because a watchdog that cannot see must never be what stops the app working. macOS additionally refuses the system-wide socket table to an unprivileged process, so the census there counts this process only and labels the number a floor. Guards: `tests/contract/test_socket_budget.py` (all three hosts faked, plus a German and a Japanese `netsh`), `tests/unit/core/test_socket_budget_watchdog.py`, `dodaios/ui/web/frontend/src/lib/connectBudget.test.ts` |
| P-45 | Medium | Hermes / OpenClaw agent runtimes | A society agent can run on Hermes or OpenClaw instead of Dodaios' own loop (docs/agent-runtimes.md), driven over ACP: Hermes as one `hermes acp` process per turn, every agent a profile of one Dodaios-owned Hermes data root (`<runtimes_root>/hermes-home/profiles/<agent>`, one shared dependency environment, prepared by the setup job); OpenClaw through `openclaw acp` against a supervised per-agent Gateway. Setup goes to the pinned `tested` release (`runtime-versions.json`) per OS: Hermes' `install.ps1` / `install.sh` at the pinned commit without browser tools or desktop control; OpenClaw as Dodaios' own copy with a private Node.js — `install.ps1 -NodeOnly` plus that Node's npm on Windows (no winget/UAC), `install-cli.sh --prefix` on macOS/Linux (no sudo). POSIX installer scripts are downloaded first and run under `set -euo pipefail`, so a missing `curl`/`git` or a failed download fails the job with a plain reason. Containment differs per OS exactly as for every CLI seat: a Job Object on Windows; a process group on POSIX plus a descendant tracker that also reaps children started under `setsid` (Hermes runs shell commands that way), found by tree walks and by a per-turn environment mark every descendant inherits, and a `gateway.pid` sweep that stops a Gateway a crashed app left behind (POSIX only — the Job Object already reaps it on Windows). Hermes' Windows home maintenance would register its data root's `bin` on the user's PATH; a `bin` file blocks that, POSIX uses `cli.expose_on_path: false`, and stale entries from older builds are removed once per run. Stop sends ACP `session/cancel` before any kill, and a stall watchdog ends a turn whose runtime stopped responding | `dodaios/agent_runtimes/` (`hermes.py`, `openclaw.py`, `base.py` (`which`, `RuntimeGate`, `HomeFileLock`, `posix_installer`, `windows_installer`), `manager.py`, `versions.py`, `runtime-versions.json`, `path_cleanup.py`), `dodaios/agent_chat/runner_cli.py` (ACP cancel + stall watchdog), `dodaios/core/process_tree.py::DescendantTracker`, `dodaios/core/path_augment.py::refresh_from_persistent_path` | Windows: verified 2026-10-07 with Hermes 0.21.5 and OpenClaw 2026.9.8 through the replay e2e spikes (both model-gateway protocols; Hermes prepare 37–45 s once, first turn 6.8–8.3 s; OpenClaw first turn 31–55 s including the Gateway cold start; the user PATH unchanged, checked against the registry), and through `tests/unit/agent_runtimes/` (fake ACP agent, fake OpenClaw CLI, injected registry). macOS/Linux: the same code paths; the setsid reaping, `flock` locks, `install-cli.sh` and `pipefail` wrapper run only on POSIX CI runners (unit tests, `agent-runtimes-canary.yml`), not verified on a real Mac or Linux desktop from this machine. Headless `python:3.11-slim`: nothing is installed or started unless an agent is switched to a runtime; without `curl`/`git` the setup fails with that reason instead of reporting success. Guards: `tests/unit/agent_runtimes/`, `tests/unit/society/test_agent_runtime_field.py` |
| P-46 | Low | Computers: this PC's SSH hosts and Tailscale | The add dialog lists the servers this PC's own `ssh` already knows and each computer can take a second address from Tailscale. Both read only local files or the local CLI, and both differ per OS only in where those live: `~/.ssh/config` and `~/.ssh/known_hosts` under the home folder (`%USERPROFILE%\.ssh` on Windows, where Git for Windows and the Windows OpenSSH client keep the same files), `Include` globs resolved relative to `~/.ssh` as OpenSSH does; the Tailscale CLI from `PATH`, else `C:\Program Files\Tailscale\tailscale.exe` (Windows) or the app bundle's `/Applications/Tailscale.app/Contents/MacOS/Tailscale` (macOS); Linux packages put it on `PATH`. A missing file, a missing CLI, a logged-out Tailscale or any error means simply nothing to offer. Every address a computer has must show the same pinned server identity, on every OS, so a second address can never reach a different machine | `dodaios/computers/ssh_config.py`, `dodaios/computers/tailscale.py` (`binary`, `peers`), `dodaios/computers/service.py` (`_open`, `add_route`), `dodaios/computers/ssh.py::key_files` | Windows: verified live 2026-10-08 (known_hosts read from `%USERPROFILE%`, no Tailscale installed: empty suggestions; routes, failover and the identity check against two local SSH servers). macOS/Linux: same code, unverified on a real box; the parsers are pure and covered by `tests/unit/computers/test_ssh_config_and_tailscale.py`, the failover by `tests/unit/computers/test_routes_and_switch.py`. Headless `python:3.11-slim`: no `~/.ssh`, no Tailscale: both lists are empty and nothing else changes |
+| P-49 | Medium | Per-user data directory and config file names | The data directory moved from `Jarvis` / `.jarvis` to `Dodaios` / `.dodaios-data`. Every process resolves it the same way: the directory under the earlier name wins while it is a real directory. Only the primary instance moves it (the source launcher right after the instance is chosen; in a frozen build the runtime hook, GUI executable only), with one rename and a link left at the old path. Whether a primary is already running is asked differently per OS: a named-mutex probe on Windows (every instance's mutex), a non-blocking lock on the existing `instance.lock` / `data/jarvis.lock` elsewhere (opened, never created). A refused rename leaves the app running from the old directory. The config file is never renamed: an existing `jarvis.toml` stays the configuration, a fresh install writes `dodaios.toml` | `dodaios/core/identity_boot.py`, `dodaios/core/identity_migration.py`, `packaging/pyinstaller_rthook_frozen.py`; `tests/unit/core/test_identity_boot.py`, `tests/unit/packaging/test_frozen_runtime_hook.py` | Windows: the link is a directory junction (no privilege needed), and the rename fails while any process holds a file open inside the directory, which keeps the old directory in use until a later start. macOS/Linux: the link is a symlink, and the rename succeeds even with files open (open handles follow the moved directory). The lock probe and the symlink run only in unit tests here, not on macOS/Linux hardware |
+| P-50 | Medium | One-line installer's install folder | The checkout moved from `~/.personal-jarvis` to `~/.dodaios`, the managed-install marker from `.jarvis-managed-install` to `.dodaios-managed-install` (the installer writes both, every reader accepts either). Both shell installers pick the earlier folder while it is a real directory and move it on an update run, after the app is stopped and before the checkout changes, by running the migration engine copied out of the fetched commit into a temporary file (`python -I -B`, from the home directory); a refused rename leaves the install where it is. Windows (`install.ps1`): the engine is written byte for byte, never through a PowerShell pipeline; the link is a directory junction; a rename fails while any process has a file open in the folder or has it as its working directory; the per-user Path swaps the old `bin` entry for the new one; a logon task or startup shortcut that still names the old path counts as current when it reaches the same file, so no second entry is written; `uninstall.ps1` deletes the junction with a non-recursive `[IO.Directory]::Delete`. macOS/Linux (`install.sh`): the link is a symlink and the rename succeeds with files open; `~/.local/bin` links through the old path are pointed at the new folder; `uninstall.sh` removes a symlink with `rm -f`, never following it. Proof so far: the extracted installer and uninstaller blocks ran on Windows against real junctions and a real git checkout (the shell blocks under Git Bash), plus a bash 3.2 parse; no full installer run, and nothing on macOS/Linux hardware |
## Agent conversation continuity and learning (2026-09-07)
diff --git a/docs/product/reference/platform-support.md b/docs/product/reference/platform-support.md
index 61fdf1761b..c63ce75942 100644
--- a/docs/product/reference/platform-support.md
+++ b/docs/product/reference/platform-support.md
@@ -145,10 +145,13 @@ surface, Dodaios falls back to the tray or no visible surface; chat continues.
## Storage and Network Defaults
-The managed installer uses `%USERPROFILE%\.personal-jarvis` on Windows and
-`~/.personal-jarvis` on macOS and Linux. Its Python environment lives inside
-that folder. Normal runtime data uses `%LOCALAPPDATA%\Jarvis` on Windows when
-that location exists and `~/.jarvis` elsewhere. Some managed-install state,
+The managed installer uses `%USERPROFILE%\.dodaios` on Windows and
+`~/.dodaios` on macOS and Linux. An install made under the earlier name
+`.personal-jarvis` keeps that folder until its next update run moves it and
+leaves a link at the old path. Its Python environment lives inside that
+folder. Normal runtime data uses `%LOCALAPPDATA%\Dodaios` on Windows when
+that location exists and `~/.dodaios-data` elsewhere (an earlier `Jarvis` or
+`~/.jarvis` folder stays in use until the app moves it). Some managed-install state,
including the default `jarvis.toml`, remains in the install folder. Read the
[Configuration Reference](configuration-reference) before changing a path on a
managed or read-only host.
diff --git a/dodaios/admin/client.py b/dodaios/admin/client.py
index a08cbb5373..1cca2a2e10 100644
--- a/dodaios/admin/client.py
+++ b/dodaios/admin/client.py
@@ -3,8 +3,8 @@
Responsibilities:
1. **Secret resolution**: on the first ``execute()`` call the HMAC secret is
- fetched from the Credential Manager (keyring service = ``personal-jarvis``,
- key = ``jarvis_admin_hmac``). If none is present → auto-generation
+ fetched from the Credential Manager (keyring service = ``dodaios``, or the
+ earlier ``personal-jarvis``; key = ``jarvis_admin_hmac``). If none is present → auto-generation
(via the ``launcher.py`` path). This module assumes the secret exists — if
not, ``execute`` fails with ``error_code="no_secret"``.
2. **Destructiveness check**: ops in ``DESTRUCTIVE_OPS`` are not sent
diff --git a/dodaios/agentic_ide/library.py b/dodaios/agentic_ide/library.py
index 7fd78fb520..14b4fb5d82 100644
--- a/dodaios/agentic_ide/library.py
+++ b/dodaios/agentic_ide/library.py
@@ -251,7 +251,12 @@ def project_id_for(path: str | Path) -> str:
# letter) still deserves a stable id, and the unresolved spelling is a
# perfectly good one. Nothing is lost, so there is nothing to report.
resolved = Path(str(path))
- key = os.path.normcase(str(resolved))
+ # A folder inside the per-user data directory (the scratch project, the
+ # chat workspace) is hashed under the directory's earliest name, so an id
+ # stored before the directory moved still matches one computed after it.
+ from dodaios.core.identity_boot import stable_data_dir_spelling
+
+ key = os.path.normcase(str(stable_data_dir_spelling(resolved)))
# Not a security boundary: this is a short, stable name for a local folder
# path, and nothing downstream trusts it or checks it. `usedforsecurity`
# says so to the reader and to the linter alike.
diff --git a/dodaios/autostart/linux.py b/dodaios/autostart/linux.py
index 7fbec4e4f9..f4601e7c46 100644
--- a/dodaios/autostart/linux.py
+++ b/dodaios/autostart/linux.py
@@ -1,6 +1,6 @@
"""Linux login autostart via the freedesktop XDG autostart spec.
-Writes ``$XDG_CONFIG_HOME/autostart/personal-jarvis.desktop`` (default
+Writes ``$XDG_CONFIG_HOME/autostart/dodaios.desktop`` (default
``~/.config/autostart/...``). Desktop environments (GNOME/KDE/XFCE/...) launch
every ``.desktop`` there at graphical login — which keeps Jarvis in the user's
session with microphone access. This is the desktop-login path chosen in
@@ -16,6 +16,14 @@ two nested escaping layers; the failure mode it prevents is specific to this fil
and invisible from both sides — the desktop discards a malformed entry without a
word, and a writer comparing its own unescaped string still reports the dead
entry as installed and current.
+
+Earlier releases wrote the entry as ``personal-jarvis.desktop``
+(``LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES``). One that starts this install
+counts as current, exactly like a logon task under its earlier name on
+Windows, so the boot reconcile leaves a working entry alone. Writing the entry
+(the Settings toggle, or a reconcile that found it stale) removes the earlier
+one, and so does an uninstall; an earlier-named entry of ANOTHER install is
+never touched (:func:`entry_belongs_to_install`).
"""
from __future__ import annotations
@@ -24,6 +32,9 @@ import logging
import os
from pathlib import Path
+from dodaios.core.branding import (
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES as _LEGACY_ENTRY_NAMES,
+)
from dodaios.core.branding import (
LINUX_APP_NAME as _APP_NAME,
)
@@ -35,6 +46,7 @@ from dodaios.core.branding import (
)
from dodaios.core.desktop_entry import (
escape_value,
+ exec_program,
exec_value,
read_field,
reads_as_false,
@@ -42,6 +54,7 @@ from dodaios.core.desktop_entry import (
unescape_value,
)
+from .paths import same_path
from .protocol import AutostartStatus, LaunchSpec
log = logging.getLogger(__name__)
@@ -152,11 +165,142 @@ def _disabled_by_desktop(text: str) -> bool:
)
+def _points_here(text: str, spec: LaunchSpec) -> bool:
+ """Does the entry start this install, under any spelling of its folder?
+
+ Exec is compared in its ENCODED form (both sides come from
+ ``_exec_value``); Path is compared decoded, so an entry another tool
+ re-encoded differently still recognises its own install. An entry written
+ before the install folder moved names the folder by its earlier path, which
+ a link still leads to: it is this install when that folder is the same one
+ on disk and its command is this command with the earlier folder spelled in.
+ """
+ stored_exec = read_field(text, "Exec")
+ stored_dir = unescape_value(read_field(text, "Path") or "")
+ if stored_exec == _exec_value(spec) and stored_dir == spec.working_dir:
+ return True
+ if not stored_dir or not same_path(stored_dir, spec.working_dir):
+ return False
+ try:
+ inner = os.path.relpath(spec.program, spec.working_dir)
+ except ValueError:
+ # Another drive (Windows only): the program is not inside the folder.
+ inner = os.pardir
+ if inner == os.pardir or inner.startswith(os.pardir + os.sep):
+ program = spec.program
+ else:
+ program = os.path.join(stored_dir, inner)
+ return stored_exec == exec_value(program, spec.args) and same_path(program, spec.program)
+
+
+def _inside(path: str, folder: str) -> bool:
+ """Is ``path`` inside ``folder`` once both are resolved on disk?"""
+ if not path or not folder:
+ return False
+ try:
+ real_path = os.path.realpath(path)
+ real_folder = os.path.realpath(folder)
+ return real_path != real_folder and (
+ os.path.commonpath([real_path, real_folder]) == real_folder
+ )
+ except (OSError, ValueError):
+ # A path that will not resolve, or sits on another drive, is not inside.
+ return False
+
+
+def entry_belongs_to_install(text: str, install_dir: str) -> bool:
+ """Does the desktop entry ``text`` start the install in ``install_dir``?
+
+ It does when its working folder (``Path=``) is that folder, under any
+ spelling that leads to it on disk, or when the program its ``Exec=`` starts
+ lies inside it (the install's virtual environment). The interpreter alone
+ proves nothing: a system ``python3`` starts every checkout on the machine.
+ Asked before an entry under an earlier name is removed, since such an
+ entry may just as well belong to another installation.
+ """
+ stored_dir = unescape_value(read_field(text, "Path") or "")
+ if stored_dir and same_path(stored_dir, install_dir):
+ return True
+ return _inside(exec_program(read_field(text, "Exec")), install_dir)
+
+
+def remove_entries_of_install(
+ paths: tuple[Path, ...] | list[Path], install_dir: str
+) -> tuple[tuple[Path, ...], tuple[str, ...]]:
+ """Delete each entry in ``paths`` that starts the install in ``install_dir``.
+
+ An entry that is missing, unreadable or another install's is kept. Returns
+ the removed paths and one message per entry that could not be removed.
+ """
+ removed: list[Path] = []
+ failures: list[str] = []
+ for path in paths:
+ try:
+ text = path.read_text(encoding="utf-8")
+ except FileNotFoundError:
+ continue # no entry under this earlier name: nothing to remove
+ except OSError as exc:
+ log.warning("Kept %s: it could not be read: %s", path, exc)
+ continue
+ if not entry_belongs_to_install(text, install_dir):
+ log.debug("Kept %s: it starts another install.", path)
+ continue
+ try:
+ path.unlink()
+ except OSError as exc:
+ log.warning("Could not remove %s: %s", path, exc)
+ failures.append(f"could not remove {path.name}: {exc}")
+ continue
+ removed.append(path)
+ log.info("Removed the desktop entry under its earlier name: %s", path)
+ return tuple(removed), tuple(failures)
+
+
class LinuxAutostart:
- """XDG ``.desktop`` autostart manager."""
+ """XDG ``.desktop`` autostart manager.
+
+ ``install_dir`` names the install an uninstall cleans up after, which
+ decides whether an earlier-named entry is this install's own when no launch
+ spec is at hand. It defaults to the running checkout, the folder
+ ``resolve_launch_spec`` writes as the entry's working folder.
+ """
+
+ def __init__(self, *, install_dir: str | None = None) -> None:
+ directory = _autostart_dir()
+ self._path = directory / _ENTRY_NAME
+ self._legacy_paths = tuple(
+ directory / name for name in _LEGACY_ENTRY_NAMES if name != _ENTRY_NAME
+ )
+ self._install_dir = install_dir
- def __init__(self) -> None:
- self._path = _autostart_dir() / _ENTRY_NAME
+ def _own_install_dir(self) -> str:
+ if self._install_dir is not None:
+ return self._install_dir
+ from dodaios.core.config import PROJECT_ROOT
+
+ return str(PROJECT_ROOT)
+
+ def _legacy_entries(self, install_dir: str) -> list[tuple[Path, str]]:
+ """Every earlier-named entry that starts THIS install, with its text."""
+ found: list[tuple[Path, str]] = []
+ for path in self._legacy_paths:
+ try:
+ text = path.read_text(encoding="utf-8")
+ except FileNotFoundError:
+ continue # no entry under this earlier name
+ except OSError as exc:
+ log.warning("Kept %s: it could not be read: %s", path, exc)
+ continue
+ if entry_belongs_to_install(text, install_dir):
+ found.append((path, text))
+ else:
+ log.debug("Kept %s: it starts another install.", path)
+ return found
+
+ def _remove_legacy(self, install_dir: str) -> str:
+ """Remove the earlier-named entries of this install; the first failure."""
+ _removed, failures = remove_entries_of_install(self._legacy_paths, install_dir)
+ return failures[0] if failures else ""
@property
def _tmp_path(self) -> Path:
@@ -171,6 +315,13 @@ class LinuxAutostart:
def status(self, spec: LaunchSpec) -> AutostartStatus:
if not self._path.exists():
+ legacy = self._legacy_entries(spec.working_dir)
+ if legacy:
+ # Written by an earlier release under the earlier name, and it
+ # starts this install: judged like the current file, so a
+ # working entry is left as it is.
+ path, text = legacy[0]
+ return self._judge(path, text, spec)
return AutostartStatus(
supported=True,
installed=False,
@@ -189,13 +340,27 @@ class LinuxAutostart:
entry_path=str(self._path),
detail=f"Autostart entry present but unreadable: {exc}.",
)
- # Exec is compared in its ENCODED form (both sides come from
- # ``_exec_value``); Path is compared decoded, so an entry another tool
- # re-encoded differently still recognises its own install.
- points_here = (
- read_field(text, "Exec") == _exec_value(spec)
- and unescape_value(read_field(text, "Path") or "") == spec.working_dir
- )
+ status = self._judge(self._path, text, spec)
+ if status.matches_spec and self._legacy_entries(spec.working_dir):
+ # Two entries of one install start the app twice at login. Not
+ # current, so the reconcile runs install(), which removes the
+ # earlier one.
+ return AutostartStatus(
+ supported=True,
+ installed=True,
+ matches_spec=False,
+ entry_path=str(self._path),
+ detail=(
+ "An autostart entry under the earlier name also starts this "
+ "install (will be removed)."
+ ),
+ )
+ return status
+
+ @staticmethod
+ def _judge(path: Path, text: str, spec: LaunchSpec) -> AutostartStatus:
+ """Status of the readable entry ``text`` at ``path`` against ``spec``."""
+ points_here = _points_here(text, spec)
switched_off = _disabled_by_desktop(text)
matches = points_here and not switched_off
if matches:
@@ -211,7 +376,7 @@ class LinuxAutostart:
supported=True,
installed=True,
matches_spec=matches,
- entry_path=str(self._path),
+ entry_path=str(path),
detail=detail,
)
@@ -233,6 +398,9 @@ class LinuxAutostart:
tmp.unlink(missing_ok=True)
raise
log.info("Linux autostart entry written: %s", self._path)
+ # Left beside the new file, the entry under the earlier name would
+ # start the app a second time at login.
+ self._remove_legacy(spec.working_dir)
return self.status(spec)
def uninstall(self, *, interactive: bool = False) -> AutostartStatus: # noqa: ARG002
@@ -251,6 +419,7 @@ class LinuxAutostart:
except OSError as exc:
log.warning("Could not remove %s: %s", self._path, exc)
error = str(exc)
+ error = error or self._remove_legacy(self._own_install_dir())
if error:
# Reporting "Autostart disabled." while the .desktop survives was a
# lie: the desktop environment still launches Jarvis at the next
@@ -275,4 +444,4 @@ class LinuxAutostart:
)
-__all__ = ["LinuxAutostart"]
+__all__ = ["LinuxAutostart", "entry_belongs_to_install", "remove_entries_of_install"]
diff --git a/dodaios/autostart/macos.py b/dodaios/autostart/macos.py
index cb765fe095..e61cbdd3a6 100644
--- a/dodaios/autostart/macos.py
+++ b/dodaios/autostart/macos.py
@@ -2,7 +2,7 @@
Writes ``~/Library/LaunchAgents/com.personal-jarvis.autostart.plist`` with
``RunAtLoad=true``. The canonical launch specification uses ``/usr/bin/open``
-to enter through ``Personal Jarvis.app`` and preserve its TCC identity. A
+to enter through the app bundle and preserve its TCC identity. A
**LaunchAgent (per-user), not a LaunchDaemon** — the agent
runs inside the user's GUI session so it keeps microphone access (a Daemon runs
as a non-interactive system context with no mic/seat, the macOS analogue of the
@@ -22,9 +22,10 @@ import subprocess
import sys
from pathlib import Path, PurePath
-from dodaios.core.branding import MACOS_APP_DIR_NAME as _APP_DIR_NAME
+from dodaios.core.branding import MACOS_APP_DIR_NAMES as _APP_DIR_NAMES
from dodaios.core.branding import MACOS_AUTOSTART_LABEL as _LABEL
+from .paths import same_path
from .protocol import AutostartStatus, LaunchSpec
log = logging.getLogger(__name__)
@@ -40,6 +41,17 @@ def _program_arguments(spec: LaunchSpec) -> list[str]:
return [spec.program, *spec.args]
+def _same_arguments(stored: object, expected: list[str]) -> bool:
+ """Equal argument lists, where an absolute path may name the same file another way."""
+ if not isinstance(stored, list) or len(stored) != len(expected):
+ return False
+ return all(
+ isinstance(have, str)
+ and (have == want or (PurePath(want).is_absolute() and same_path(have, want)))
+ for have, want in zip(stored, expected, strict=True)
+ )
+
+
def _launchctl(*argv: str) -> bool:
"""Best-effort ``launchctl`` call — darwin-only, never raises.
@@ -92,7 +104,9 @@ def _write_plist_atomically(path: Path, plist: dict) -> None:
def retarget_launch_agent(bundle: PurePath) -> bool:
"""Point an existing LaunchAgent at ``bundle`` after the app moved.
- The entry names the app by absolute path. Whoever moves the bundle has to
+ The entry names the app by absolute path, under the bundle's current name
+ or an earlier one (a bundle renamed in place is followed the same way; the
+ label stays). Whoever moves the bundle has to
move the entry with it IN THE SAME STEP: the boot-time reconcile only runs
once the app is up, and an entry aimed at the old path is exactly what
keeps it from coming up at login — the app would stay gone from login
@@ -114,7 +128,7 @@ def retarget_launch_agent(bundle: PurePath) -> bool:
target = str(bundle)
updated = [
target
- if isinstance(arg, str) and Path(arg).name == _APP_DIR_NAME and arg != target
+ if isinstance(arg, str) and Path(arg).name in _APP_DIR_NAMES and arg != target
else arg
for arg in arguments
]
@@ -159,9 +173,12 @@ class MacOSAutostart:
entry_path=str(self._path),
detail=f"LaunchAgent present but unparsable: {exc}.",
)
+ # A path that reaches the same file through the link an install-folder
+ # move left behind is still this install, not a different one.
matches = (
- data.get("ProgramArguments") == _program_arguments(spec)
- and data.get("WorkingDirectory") == spec.working_dir
+ _same_arguments(data.get("ProgramArguments"), _program_arguments(spec))
+ and isinstance(data.get("WorkingDirectory"), str)
+ and same_path(data["WorkingDirectory"], spec.working_dir)
and data.get("RunAtLoad") is True
and data.get("ProcessType") == "Interactive"
and data.get("LimitLoadToSessionType") == "Aqua"
diff --git a/dodaios/autostart/paths.py b/dodaios/autostart/paths.py
new file mode 100644
index 0000000000..9ef3edbed6
--- /dev/null
+++ b/dodaios/autostart/paths.py
@@ -0,0 +1,46 @@
+"""Does a path stored in an autostart entry name the place the app would write now?
+
+An entry stores absolute paths: the interpreter, the working folder. When the
+install folder moves to its current name, a link stays behind at the earlier
+path, so an entry written before the move still starts the app, through that
+link. Its text no longer matches, though, and an entry judged stale is
+rewritten; on Windows the boot repair cannot rewrite a logon task without an
+elevation prompt and adds a startup shortcut instead, and the app then starts
+twice at login. So a path counts as the same when its text matches (ignoring
+letter case and separators on Windows) or when it is the very same file or
+folder on disk. A path that does not exist matches only by its text.
+"""
+
+from __future__ import annotations
+
+import ntpath
+import os
+
+
+def _windows_text(path: str) -> str:
+ return ntpath.normcase(ntpath.normpath(path))
+
+
+def same_path(stored: str | None, expected: str | None, *, windows: bool = False) -> bool:
+ """True when ``stored`` and ``expected`` name one place.
+
+ ``windows`` compares the text the way Windows resolves it: case-blind,
+ either separator. Empty values match only each other.
+ """
+ stored = stored or ""
+ expected = expected or ""
+ if not stored or not expected:
+ return stored == expected
+ if windows:
+ if _windows_text(stored) == _windows_text(expected):
+ return True
+ elif stored == expected:
+ return True
+ try:
+ return os.path.samefile(stored, expected)
+ except (OSError, ValueError):
+ # One side is missing or unreadable: only the text could have matched.
+ return False
+
+
+__all__ = ["same_path"]
diff --git a/dodaios/autostart/windows.py b/dodaios/autostart/windows.py
index da6bdd7825..ef037109ee 100644
--- a/dodaios/autostart/windows.py
+++ b/dodaios/autostart/windows.py
@@ -53,7 +53,12 @@ from pathlib import Path
from typing import TypeVar
from dodaios.core.branding import (
+ LEGACY_PACKAGE_NAMES,
+ LEGACY_WINDOWS_AUTOSTART_TASK_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
WINDOWS_AUTOSTART_DESCRIPTION,
+ WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
)
from dodaios.core.branding import (
WINDOWS_AUTOSTART_TASK_NAME as TASK_NAME,
@@ -63,6 +68,7 @@ from dodaios.core.branding import (
)
from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
+from .paths import same_path
from .protocol import AutostartStatus, LaunchSpec
log = logging.getLogger(__name__)
@@ -74,9 +80,26 @@ _T = TypeVar("_T")
# without the multi-minute Explorer startup throttle.
_LOGON_DELAY_SECONDS = 20
-# Divergent names the old wizard/install paths used — removed on every write so
-# Jarvis never auto-starts twice.
-_LEGACY_NAMES = ("Jarvis.lnk", "Jarvis.bat", "Personal Jarvis.bat")
+# Divergent names the old wizard/install paths used, and the startup shortcut
+# under the product's earlier name: removed on every write so the app never
+# auto-starts twice.
+_LEGACY_NAMES = (
+ "Jarvis.lnk",
+ "Jarvis.bat",
+ "Personal Jarvis.bat",
+ *LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
+)
+# The branded launcher under every name it has had. A logon task written by an
+# earlier release starts the earlier file, which the install still ships beside
+# the current one (``jarvis.spec``): the same program in the same folder.
+_BRANDED_LAUNCHER_NAMES = frozenset(
+ name.lower()
+ for name in (WINDOWS_BRANDED_LAUNCHER_FILE_NAME, *LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES)
+)
+# The import name the launcher module is started under now. A task written
+# before the package moved names it by an earlier one, which still resolves to
+# the same module (the compatibility package), so both spell the same command.
+_PACKAGE_NAME = __name__.split(".", 1)[0]
_READBACK_SENTINEL = "<<<JARVIS_LNK>>>"
_QUERY_SENTINEL = "<<<JARVIS_TASK>>>"
@@ -107,8 +130,39 @@ def _shortcut_path() -> Path:
return _startup_dir() / _SHORTCUT_NAME
-def _norm(p: str | None) -> str:
- return ntpath.normcase(ntpath.normpath(p)) if p else ""
+def _same_program(actual: str, expected: str) -> bool:
+ """Do two executable paths start the same program?
+
+ The same path does (by text or, through a link left at an earlier install
+ folder, by file: ``same_path``), and so does the branded launcher under its
+ current and its earlier name in one folder, as long as the earlier file is
+ still there: the install ships both.
+ """
+ if same_path(actual, expected, windows=True):
+ return True
+ # ``ntpath.split`` splits at either separator and keeps the text as it is,
+ # so ``same_path`` can still find the folder on disk by its real spelling.
+ actual_dir, actual_name = ntpath.split(actual) if actual else ("", "")
+ expected_dir, expected_name = ntpath.split(expected) if expected else ("", "")
+ return (
+ bool(actual_dir)
+ and same_path(actual_dir, expected_dir, windows=True)
+ and actual_name.lower() in _BRANDED_LAUNCHER_NAMES
+ and expected_name.lower() in _BRANDED_LAUNCHER_NAMES
+ and os.path.isfile(actual)
+ )
+
+
+def _canonical_arguments(arguments: str) -> str:
+ """``arguments`` with a module started under an earlier package name renamed."""
+ parts = arguments.split()
+ for index in range(1, len(parts)):
+ if parts[index - 1] != "-m":
+ continue
+ head, dot, tail = parts[index].partition(".")
+ if head in LEGACY_PACKAGE_NAMES:
+ parts[index] = f"{_PACKAGE_NAME}{dot}{tail}"
+ return " ".join(parts)
def _current_user_id() -> str:
@@ -149,10 +203,19 @@ def _ps_lit(value: object) -> str:
def build_register_task_script(
- task_name: str, spec: LaunchSpec, user_id: str, *, delay_seconds: int = _LOGON_DELAY_SECONDS
+ task_name: str,
+ spec: LaunchSpec,
+ user_id: str,
+ *,
+ delay_seconds: int = _LOGON_DELAY_SECONDS,
+ replaced_task_names: tuple[str, ...] = (),
) -> str:
"""Pure: the elevated PowerShell that registers the logon task.
+ ``replaced_task_names`` are removed in the same elevated step, AFTER the new
+ task is registered: a failed registration leaves them untouched, so the
+ login start never ends up with no task at all and never with two.
+
``RunLevel=Limited`` → the launched Jarvis is NOT elevated (mic access);
``AtLogOn`` + ``Delay`` → fires a few seconds after login, off the Explorer
startup throttle. ``-Priority 5`` → Normal process priority: Task Scheduler's
@@ -178,11 +241,21 @@ def build_register_task_script(
f" Register-ScheduledTask -TaskName '{_ps_lit(task_name)}' -Action $action "
"-Trigger $trigger -Principal $principal -Settings $settings "
f"-Description '{_ps_lit(WINDOWS_AUTOSTART_DESCRIPTION)}' -Force | Out-Null\n"
+ f"{_unregister_lines(replaced_task_names)}"
" exit 0\n"
"} catch { exit 1 }\n"
)
+def _unregister_lines(task_names: tuple[str, ...]) -> str:
+ """Pure: one idempotent ``Unregister-ScheduledTask`` line per name."""
+ return "".join(
+ f" Unregister-ScheduledTask -TaskName '{_ps_lit(name)}' -Confirm:$false "
+ "-ErrorAction SilentlyContinue\n"
+ for name in task_names
+ )
+
+
def _ps_emit_field(sentinel: str, expression: str) -> str:
"""Pure: one PowerShell line that prints ``expression`` base64-of-UTF-8.
@@ -194,7 +267,7 @@ def _ps_emit_field(sentinel: str, expression: str) -> str:
profile or project path came back corrupted, and some do not survive at all:
byte 0x81 (u-umlaut in cp850) has no cp1252 mapping, so it RAISES inside
subprocess's reader thread and the caller gets nothing. Either way
- ``_norm(readback) != _norm(spec)``, so the task/shortcut was reported as
+ the read-back never equalled the spec, so the task/shortcut was reported as
"points at a different install" forever — at every single login, on every
profile whose name is not plain ASCII. Base64 is pure ASCII, so it survives
any code page byte for byte and the value is reconstructed exactly (AP-7's
@@ -229,13 +302,12 @@ def build_query_task_script(task_name: str) -> str:
)
-def build_unregister_task_script(task_name: str) -> str:
- """Pure: elevated PowerShell that removes the task (idempotent)."""
+def build_unregister_task_script(task_name: str, *more_task_names: str) -> str:
+ """Pure: elevated PowerShell that removes the task(s) (idempotent), in one step."""
return (
"$ErrorActionPreference = 'Stop'\n"
"try {\n"
- f" Unregister-ScheduledTask -TaskName '{_ps_lit(task_name)}' -Confirm:$false "
- "-ErrorAction SilentlyContinue\n"
+ f"{_unregister_lines((task_name, *more_task_names))}"
" exit 0\n"
"} catch { exit 1 }\n"
)
@@ -371,7 +443,7 @@ def _icon_matches(actual: str, expected: str | None) -> bool:
if expected is None:
return True
path = (actual or "").rsplit(",", 1)[0].strip().strip('"')
- return bool(path) and _norm(path) == _norm(expected)
+ return bool(path) and same_path(path, expected, windows=True)
def _tag_shortcut_aumid(link: Path) -> bool:
@@ -680,13 +752,20 @@ class WindowsAutostart:
The side-effecting operations (task probe, elevated run, shortcut I/O) are
injectable so the decision logic is CI-provable without a real Task Scheduler,
UAC prompt, or ``WScript.Shell``.
+
+ The task may still carry an earlier name (``legacy_task_names``). One that
+ starts this install counts as current, so the silent boot reconcile never
+ needs elevation for the rename; an interactive enable registers the task
+ under the current name and removes the earlier one in the same elevated
+ step, and an uninstall removes every name.
"""
def __init__(
self,
*,
task_name: str = TASK_NAME,
- task_probe: Callable[[], _TaskInfo | None] | None = None,
+ legacy_task_names: tuple[str, ...] = LEGACY_WINDOWS_AUTOSTART_TASK_NAMES,
+ task_probe: Callable[[str], _TaskInfo | None] | None = None,
run_elevated: Callable[[str], bool] | None = None,
shortcut_present: Callable[[], bool] | None = None,
shortcut_matches: Callable[[LaunchSpec], bool] | None = None,
@@ -694,32 +773,51 @@ class WindowsAutostart:
remove_shortcut: Callable[[], None] | None = None,
) -> None:
self._task_name = task_name
+ self._legacy_task_names = tuple(name for name in legacy_task_names if name != task_name)
self._path = _shortcut_path()
self._task_probe = task_probe or self._default_task_probe
self._run_elevated = run_elevated or _run_powershell_elevated
- self._shortcut_present = shortcut_present or (lambda: self._path.exists())
+ self._shortcut_present = shortcut_present or self._default_shortcut_present
self._shortcut_matches = shortcut_matches or self._default_shortcut_matches
self._write_shortcut = write_shortcut or self._default_write_shortcut
self._remove_shortcut = remove_shortcut or self._default_remove_shortcut
# ---- entry helpers -----------------------------------------------------
- def _task_entry_path(self) -> str:
- return f"Task Scheduler\\{self._task_name}"
+ def _task_entry_path(self, task_name: str | None = None) -> str:
+ return f"Task Scheduler\\{task_name or self._task_name}"
+
+ def _find_task(self) -> tuple[str, _TaskInfo] | None:
+ """The logon task and the name it is registered under, current name first.
+
+ An earlier name is only asked for while the current one is absent, so
+ an install whose task already moved pays for one probe.
+ """
+ for name in (self._task_name, *self._legacy_task_names):
+ info = self._task_probe(name)
+ if info is not None:
+ return name, info
+ return None
@staticmethod
def _task_matches(info: _TaskInfo, spec: LaunchSpec) -> bool:
+ # The same file counts, not only the same text: a task written before
+ # the install folder moved reaches the app through the link left at
+ # the earlier path. Judged stale, it could not be rewritten without an
+ # elevation prompt, and the shortcut written instead would start the
+ # app a second time at login.
return (
- _norm(info.execute) == _norm(spec.program)
- and info.arguments.strip() == " ".join(spec.args).strip()
- and _norm(info.working_dir) == _norm(spec.working_dir)
+ _same_program(info.execute, spec.program)
+ and _canonical_arguments(info.arguments) == _canonical_arguments(" ".join(spec.args))
+ and same_path(info.working_dir, spec.working_dir, windows=True)
)
# ---- protocol ----------------------------------------------------------
def status(self, spec: LaunchSpec) -> AutostartStatus:
- info = self._task_probe()
- if info is not None:
+ found = self._find_task()
+ if found is not None:
+ task_name, info = found
action_matches = self._task_matches(info, spec)
# A startup shortcut left beside a matching task launches the app a
# second time at login, and with whatever working folder it was
@@ -759,7 +857,7 @@ class WindowsAutostart:
supported=True,
installed=True,
matches_spec=action_matches and info.enabled and not leftover_shortcut,
- entry_path=self._task_entry_path(),
+ entry_path=self._task_entry_path(task_name),
detail=detail,
)
if self._shortcut_present():
@@ -786,8 +884,14 @@ class WindowsAutostart:
# "Correct" includes being switched ON: a disabled task matches the spec
# but never fires, so it must fall through to the refresh/fallback path
# below instead of being reported as done.
- info = self._task_probe()
- if info is not None and info.enabled and self._task_matches(info, spec):
+ found = self._find_task()
+ info = found[1] if found is not None else None
+ task_current = info is not None and info.enabled and self._task_matches(info, spec)
+ # A task under an earlier name that starts this install is current
+ # too. Only an interactive enable moves it to the current name below:
+ # that needs the one elevation a silent boot must never ask for.
+ under_current_name = found is not None and found[0] == self._task_name
+ if task_current and (under_current_name or not interactive):
# ...except for a leftover fallback .lnk. A boot whose task probe
# transiently failed (PowerShell is slow under login load, and a
# failed query is treated as "no task") writes the shortcut, and
@@ -805,13 +909,24 @@ class WindowsAutostart:
if interactive:
user_id = _current_user_id()
- script = build_register_task_script(self._task_name, spec, user_id)
+ script = build_register_task_script(
+ self._task_name, spec, user_id, replaced_task_names=self._legacy_task_names
+ )
if self._run_elevated(script):
# Task created → remove the throttled fallback so Jarvis won't
# start twice (once via task, once via the .lnk).
self._remove_shortcut()
log.info("Windows autostart scheduled task registered: %s", self._task_name)
return self.status(spec)
+ if task_current:
+ # The rename was declined, but the task under its earlier name
+ # still starts this install at login. A fallback shortcut beside
+ # it would start the app a second time.
+ log.info(
+ "Autostart task rename not granted (UAC declined) — the task "
+ "under its earlier name keeps starting this install."
+ )
+ return self.status(spec)
log.info(
"Autostart task not granted (UAC declined) — using startup shortcut fallback."
)
@@ -837,11 +952,12 @@ class WindowsAutostart:
def uninstall(self, *, interactive: bool = False) -> AutostartStatus:
self._remove_shortcut() # non-elevated, always
- info = self._task_probe()
- if info is not None and interactive:
- self._run_elevated(build_unregister_task_script(self._task_name))
- info = self._task_probe() # did the elevated removal actually land?
- if info is not None:
+ registered = self._registered_task_names()
+ if registered and interactive:
+ # Every name in one elevated step: one prompt, never two.
+ self._run_elevated(build_unregister_task_script(*registered))
+ registered = self._registered_task_names() # did the removal land?
+ if registered:
# Unregistering the task needs elevation: the silent boot reconcile
# must never prompt, and an interactive user can decline the UAC
# prompt. Reporting "disabled" in either case was a lie — the
@@ -855,7 +971,7 @@ class WindowsAutostart:
supported=True,
installed=True,
matches_spec=False,
- entry_path=self._task_entry_path(),
+ entry_path=self._task_entry_path(registered[0]),
detail=(
"Startup shortcut removed, but the scheduled task still starts "
"Dodaios at login — turn instant start off in Settings and "
@@ -870,18 +986,26 @@ class WindowsAutostart:
detail="Autostart disabled.",
)
+ def _registered_task_names(self) -> tuple[str, ...]:
+ """Every name, current and earlier, a logon task is registered under."""
+ return tuple(
+ name
+ for name in (self._task_name, *self._legacy_task_names)
+ if self._task_probe(name) is not None
+ )
+
# ---- real (live) default operations ------------------------------------
- def _default_task_probe(self) -> _TaskInfo | None:
+ def _default_task_probe(self, task_name: str) -> _TaskInfo | None:
try:
- return _query_task_in_process(self._task_name)
+ return _query_task_in_process(task_name)
except LookupError:
pass # no pywin32 → the PowerShell query below
except Exception as exc: # noqa: BLE001 — query failure → treat as absent
log.debug("scheduled-task query failed: %s", exc)
return None
try:
- result = _run_powershell(build_query_task_script(self._task_name))
+ result = _run_powershell(build_query_task_script(task_name))
except Exception as exc: # noqa: BLE001 — query failure → treat as absent
log.debug("scheduled-task query failed: %s", exc)
return None
@@ -907,12 +1031,19 @@ class WindowsAutostart:
return False
target, args, workdir, icon = fields[:4]
return (
- _norm(target) == _norm(spec.program)
+ same_path(target, spec.program, windows=True)
and args.strip() == " ".join(spec.args).strip()
- and _norm(workdir) == _norm(spec.working_dir)
+ and same_path(workdir, spec.working_dir, windows=True)
and _icon_matches(icon, _resolve_app_icon())
)
+ def _default_shortcut_present(self) -> bool:
+ # A startup entry under an earlier name starts the app just the same, so
+ # it counts: beside a task it is a leftover, and alone it is rewritten
+ # under the current name.
+ startup = _startup_dir()
+ return self._path.exists() or any((startup / name).exists() for name in _LEGACY_NAMES)
+
def _remove_legacy(self) -> None:
startup = _startup_dir()
for name in _LEGACY_NAMES:
diff --git a/dodaios/core/branding.py b/dodaios/core/branding.py
index f9cdb7b709..0086eae096 100644
--- a/dodaios/core/branding.py
+++ b/dodaios/core/branding.py
@@ -40,21 +40,56 @@ PERSISTENT_SLUG = "personal-jarvis"
# text, and hold the same values as ever.
PRODUCT_COMPACT_NAME = PERSISTENT_COMPACT_NAME
PRODUCT_SLUG = PERSISTENT_SLUG
-# The name the operating system lists the app under: the Start-Menu shortcut,
-# the macOS bundle, the Linux desktop entry, the entry in Installed Apps. Text
-# that tells a person where to find the app in the OS uses this name, because
-# that is what they will see there until those artifacts are migrated.
-LAUNCHER_ENTRY_NAME = PERSISTENT_PRODUCT_NAME
-
-CONFIG_FILE_NAME = "jarvis.toml"
-KEYRING_SERVICE_NAME = PERSISTENT_SLUG
+# The name Windows lists the app under: the Start-Menu and Desktop shortcut, the
+# entry in Installed Apps, the toast identity. Text that tells a person where to
+# find the app on Windows uses this name. The macOS bundle and the Linux desktop
+# entry have names of their own (``MACOS_APP_NAME``, ``LINUX_APP_NAME``), each
+# moved with its own migration.
+LAUNCHER_ENTRY_NAME = "Dodaios"
+LEGACY_LAUNCHER_ENTRY_NAMES = (PERSISTENT_PRODUCT_NAME,)
+
+# The configuration file's name. A file under an earlier name is never
+# renamed: while it exists it stays the configuration, and only an install
+# that has none creates one under the current name
+# (``dodaios.core.config.resolve_config_file``).
+CONFIG_FILE_NAME = "dodaios.toml"
+LEGACY_CONFIG_FILE_NAMES = ("jarvis.toml",)
+# The credential-store service every key is filed under (Windows Credential
+# Manager, macOS Keychain, Secret Service, the 0600 file fallback). Spelled as
+# a literal of its own, like the commands: it does not follow the display name.
+KEYRING_SERVICE_NAME = "dodaios"
+# Services earlier versions filed keys under. ``dodaios.core.config`` reads
+# them as a fallback and deletes from them too, and a background job copies
+# their entries once (``dodaios.core.identity_credentials``). Nothing deletes
+# a legacy entry except an explicit delete of that key: it is the way back for
+# a downgrade.
+LEGACY_KEYRING_SERVICE_NAMES = (PERSISTENT_SLUG,)
CONTROL_KEY_PREFIX = "jctl_"
SESSION_COOKIE_NAME = "jarvis_session"
-MANAGED_INSTALL_MARKER = ".jarvis-managed-install"
-DEFAULT_INSTALL_DIR_NAME = f".{PERSISTENT_SLUG}"
+# The file the one-line installer writes into the checkout it manages. Its
+# presence (together with the official origin) is what lets the in-app updater
+# reset the checkout. The installer writes every name, so an updater of any
+# version recognises the checkout; every reader accepts any of them.
+MANAGED_INSTALL_MARKER = ".dodaios-managed-install"
+LEGACY_MANAGED_INSTALL_MARKERS = (".jarvis-managed-install",)
+MANAGED_INSTALL_MARKERS = (MANAGED_INSTALL_MARKER, *LEGACY_MANAGED_INSTALL_MARKERS)
+# The one-line installer's checkout in the home directory. An install under an
+# earlier name keeps it while it is a real directory; an update run moves it by
+# one rename and leaves a link behind (``install/install.sh``,
+# ``install/install.ps1``, through ``dodaios.core.identity_migration``).
+DEFAULT_INSTALL_DIR_NAME = ".dodaios"
+LEGACY_DEFAULT_INSTALL_DIR_NAMES = (f".{PERSISTENT_SLUG}",)
# The Python distribution name (``pip install <name>``) and with it the
# ``share/<name>`` directory a wheel installs its data files under.
-DISTRIBUTION_NAME = PERSISTENT_SLUG
+DISTRIBUTION_NAME = "dodaios"
+# The distribution's earlier name. Releases publish the same wheel under it for
+# a transition, so ``pip install -U <earlier name>`` keeps updating; its data
+# files stay under ``share/<earlier name>``, which every reader still accepts.
+# Both own the same package files, so an environment should hold only one:
+# the installer removes the earlier one before installing, and the app warns
+# once when it finds both (``dodaios.core.distribution``).
+LEGACY_DISTRIBUTION_NAMES = (PERSISTENT_SLUG,)
+DISTRIBUTION_NAMES = (DISTRIBUTION_NAME, *LEGACY_DISTRIBUTION_NAMES)
# Terminal commands the install puts on PATH. No command may equal the branded
# launcher's name ignoring case: on Windows and macOS they would be one file.
@@ -80,9 +115,28 @@ SHELL_PROFILE_MARKER = (
)
FISH_CONF_FILE_NAME = f"{PERSISTENT_SLUG}.fish"
-WINDOWS_USER_DATA_DIR_NAME = "Jarvis"
-FALLBACK_USER_DATA_DIR_NAME = ".jarvis"
-DESKTOP_OUTPUT_MIRROR_DIR_NAME = "Jarvis-Output"
+# The per-user data directory: ``%LOCALAPPDATA%\<name>`` on Windows, ``~/<name>``
+# elsewhere. An existing installation keeps its directory under the earlier
+# name until the primary instance moves it (``dodaios.core.identity_boot``);
+# while a real directory still stands under an earlier name, that one is used.
+WINDOWS_USER_DATA_DIR_NAME = "Dodaios"
+LEGACY_WINDOWS_USER_DATA_DIR_NAMES = ("Jarvis",)
+FALLBACK_USER_DATA_DIR_NAME = ".dodaios-data"
+LEGACY_FALLBACK_USER_DATA_DIR_NAMES = (".jarvis",)
+# Folders a person opens themselves. They are found under an earlier name for
+# as long as one exists there and are never moved, so nothing on the Desktop or
+# in Downloads changes its name under the user's hands.
+DESKTOP_OUTPUT_MIRROR_DIR_NAME = "Dodaios-Output"
+LEGACY_DESKTOP_OUTPUT_MIRROR_DIR_NAMES = ("Jarvis-Output",)
+# Where finished mission deliverables are mirrored (Downloads, Desktop or the
+# home directory; lower-cased on a system without a file explorer).
+DELIVERABLES_DIR_NAME = "Dodaios-Outputs"
+LEGACY_DELIVERABLES_DIR_NAMES = ("Jarvis-Outputs",)
+# The folder created inside an existing Obsidian vault the user registers.
+# Only a new registration uses it; a vault root already saved in the
+# configuration keeps naming the folder it names.
+OBSIDIAN_VAULT_FOLDER_NAME = "Dodaios"
+LEGACY_OBSIDIAN_VAULT_FOLDER_NAMES = ("Jarvis",)
# --- Marketplace manifest namespace -------------------------------------------
# The key a plugin package keeps this app's own data under
@@ -93,23 +147,64 @@ DESKTOP_OUTPUT_MIRROR_DIR_NAME = "Jarvis-Output"
MARKETPLACE_EXTENSION_NAMESPACE = "io.github.dodaios"
LEGACY_MARKETPLACE_EXTENSION_NAMESPACES = ("io.github.personaljarvis",)
-WINDOWS_MUTEX_NAME = rf"Global\{PERSISTENT_COMPACT_NAME}_v1"
+# The single-instance mutex the primary desktop app holds. A primary claims the
+# current name and every earlier one, and a process that finds any of them taken
+# is a secondary: an old and a new release never run side by side
+# (``dodaios.ui.shell.single_instance``).
+WINDOWS_MUTEX_NAME = r"Global\Dodaios_v1"
+LEGACY_WINDOWS_MUTEX_NAMES = (rf"Global\{PERSISTENT_COMPACT_NAME}_v1",)
+# Kept on purpose: the taskbar groups windows, and resolves pins, by this id.
WINDOWS_APP_USER_MODEL_ID = f"{PERSISTENT_COMPACT_NAME}.{PERSISTENT_COMPACT_NAME}"
+# Kept on purpose: the key a source install's Installed Apps entry lives under.
+# Only the DisplayName written into it follows ``LAUNCHER_ENTRY_NAME``.
WINDOWS_UNINSTALL_REGISTRY_SUBKEY = (
rf"Software\Microsoft\Windows\CurrentVersion\Uninstall\{PERSISTENT_COMPACT_NAME}"
)
-WINDOWS_AUTOSTART_TASK_NAME = f"{PERSISTENT_PRODUCT_NAME} Autostart"
-WINDOWS_SHORTCUT_FILE_NAME = f"{PERSISTENT_PRODUCT_NAME}.lnk"
-WINDOWS_AUTOSTART_DESCRIPTION = f"{PERSISTENT_PRODUCT_NAME} (Autostart)"
-WINDOWS_BRANDED_LAUNCHER_FILE_NAME = f"{PERSISTENT_COMPACT_NAME}.exe"
-WINDOWS_BRANDED_LAUNCHER_DIR_NAME = PERSISTENT_COMPACT_NAME
+# The logon task. A task registered under an earlier name keeps working and
+# counts as current; only an interactive enable registers it under the current
+# name, removing the earlier one in the same elevated step
+# (``dodaios.autostart.windows``).
+WINDOWS_AUTOSTART_TASK_NAME = "Dodaios Autostart"
+LEGACY_WINDOWS_AUTOSTART_TASK_NAMES = (f"{PERSISTENT_PRODUCT_NAME} Autostart",)
+WINDOWS_AUTOSTART_DESCRIPTION = "Dodaios (Autostart)"
+LEGACY_WINDOWS_AUTOSTART_DESCRIPTIONS = (f"{PERSISTENT_PRODUCT_NAME} (Autostart)",)
+# The Start-Menu, Desktop and Startup shortcut. A shortcut under an earlier name
+# is removed only where it points into this installation.
+WINDOWS_SHORTCUT_FILE_NAME = "Dodaios.lnk"
+LEGACY_WINDOWS_SHORTCUT_FILE_NAMES = (f"{PERSISTENT_PRODUCT_NAME}.lnk",)
+# The windowed executable: the branded pythonw copy of a source install and the
+# GUI executable of the frozen build (``jarvis.spec``). Not ``Dodaios.exe``: it
+# shares a folder with the ``dodaios`` command, and Windows paths ignore case.
+# Earlier names are still found, and the frozen build still ships one, because
+# taskbar pins, scheduled tasks and shortcuts name that file.
+WINDOWS_BRANDED_LAUNCHER_FILE_NAME = "DodaiosApp.exe"
+LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES = (f"{PERSISTENT_COMPACT_NAME}.exe",)
+# ``%LOCALAPPDATA%\<name>\bin``, the per-user home of the branded copy. Not the
+# plain product name: that is the data directory beside it.
+WINDOWS_BRANDED_LAUNCHER_DIR_NAME = "DodaiosApp"
+LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES = (PERSISTENT_COMPACT_NAME,)
+# Kept on purpose: a process of an earlier release sets and reads it.
WINDOWS_BRANDED_LAUNCH_ENV_VAR = "JARVIS_BRANDED_LAUNCH"
# The bundle name: ``/Applications/<name>.app``, and the name macOS lists the
-# app under in Launchpad and in System Settings > Privacy & Security.
-MACOS_APP_NAME = PERSISTENT_PRODUCT_NAME
+# app under in Finder, Launchpad and System Settings > Privacy & Security. A
+# bundle of ours under an earlier name is renamed once, in place
+# (``dodaios.setup.macos_app_bundle``); a rename keeps its signature, and with
+# it every privacy grant, because those name the bundle id and the signing
+# requirement, never the path. The bundle ids, the login item's label and the
+# signing identity below did NOT move: a new one starts the grants over.
+MACOS_APP_NAME = "Dodaios"
+LEGACY_MACOS_APP_NAMES = (PERSISTENT_PRODUCT_NAME,)
MACOS_APP_DIR_NAME = f"{MACOS_APP_NAME}.app"
-MACOS_EXECUTABLE_NAME = PERSISTENT_COMPACT_NAME
+LEGACY_MACOS_APP_DIR_NAMES = tuple(f"{name}.app" for name in LEGACY_MACOS_APP_NAMES)
+# Every name a bundle of ours may carry in an Applications folder, current first.
+MACOS_APP_DIR_NAMES = (MACOS_APP_DIR_NAME, *LEGACY_MACOS_APP_DIR_NAMES)
+# ``Contents/MacOS/<name>``: the same program as the Windows GUI executable
+# (``jarvis.spec`` builds both under one name). A bundle's designated
+# requirement names its bundle id and certificate, not this file, so the
+# rename keeps every privacy grant.
+MACOS_EXECUTABLE_NAME = "DodaiosApp"
+LEGACY_MACOS_EXECUTABLE_NAMES = (PERSISTENT_COMPACT_NAME,)
MACOS_BUNDLE_ID = f"com.{PERSISTENT_SLUG}.desktop"
# The downloadable .dmg (PyInstaller, ``jarvis.spec``) is a second, equally
# legitimate installed app: its own bundle id and therefore its own macOS
@@ -119,11 +214,22 @@ MACOS_DMG_BUNDLE_ID = f"ai.{PERSISTENT_COMPACT_NAME.lower()}.desktop"
MACOS_AUTOSTART_LABEL = f"com.{PERSISTENT_SLUG}.autostart"
# Common name of the per-user self-signed code-signing certificate the
# installer creates so the app bundle keeps one TCC identity across rebuilds.
-MACOS_SIGNING_IDENTITY_LABEL = f"{MACOS_APP_NAME} Local Signing"
+# Kept on purpose: the certificate already in a user's keychain carries it.
+MACOS_SIGNING_IDENTITY_LABEL = f"{PERSISTENT_PRODUCT_NAME} Local Signing"
-LINUX_APP_NAME = PERSISTENT_PRODUCT_NAME
-LINUX_DESKTOP_ENTRY_FILE_NAME = f"{PERSISTENT_SLUG}.desktop"
-LINUX_WM_CLASS = PERSISTENT_SLUG
+# The Linux desktop entry: the name the app menu lists, the entry's file name
+# (in ``applications`` and in ``autostart``) and the window class the running
+# window is pinned to. The three move together: a desktop binds a running
+# window to the entry whose ``StartupWMClass`` equals the window's class, and
+# shows that entry's icon for it. An entry under an earlier name is removed
+# only where it starts this installation, and an earlier-named autostart entry
+# that starts this installation counts as current (``dodaios.autostart.linux``).
+LINUX_APP_NAME = "Dodaios"
+LEGACY_LINUX_APP_NAMES = (PERSISTENT_PRODUCT_NAME,)
+LINUX_DESKTOP_ENTRY_FILE_NAME = "dodaios.desktop"
+LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES = (f"{PERSISTENT_SLUG}.desktop",)
+LINUX_WM_CLASS = "dodaios"
+LEGACY_LINUX_WM_CLASSES = (PERSISTENT_SLUG,)
# --- Plugin entry-point groups -------------------------------------------------
# A plugin registers under ``<namespace>.<slot>`` (``dodaios.tool``,
@@ -191,23 +297,49 @@ __all__ = [
"CONTROL_KEY_PREFIX",
"DEFAULT_OFFICIAL_REPO_SLUG",
"DEFAULT_INSTALL_DIR_NAME",
+ "LEGACY_DEFAULT_INSTALL_DIR_NAMES",
+ "LEGACY_MANAGED_INSTALL_MARKERS",
+ "DELIVERABLES_DIR_NAME",
"LEGACY_CLI_COMMAND_NAMES",
+ "LEGACY_CONFIG_FILE_NAMES",
+ "LEGACY_DELIVERABLES_DIR_NAMES",
+ "LEGACY_DESKTOP_OUTPUT_MIRROR_DIR_NAMES",
+ "LEGACY_FALLBACK_USER_DATA_DIR_NAMES",
+ "LEGACY_OBSIDIAN_VAULT_FOLDER_NAMES",
+ "LEGACY_LAUNCHER_ENTRY_NAMES",
+ "LEGACY_MACOS_APP_DIR_NAMES",
+ "LEGACY_MACOS_APP_NAMES",
+ "LEGACY_MACOS_EXECUTABLE_NAMES",
+ "LEGACY_WINDOWS_AUTOSTART_DESCRIPTIONS",
+ "LEGACY_WINDOWS_AUTOSTART_TASK_NAMES",
+ "LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES",
+ "LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES",
+ "LEGACY_WINDOWS_SHORTCUT_FILE_NAMES",
+ "LEGACY_WINDOWS_MUTEX_NAMES",
+ "LEGACY_WINDOWS_USER_DATA_DIR_NAMES",
"LEGACY_CONTROL_CLI_COMMAND_NAMES",
"LEGACY_OFFICIAL_REPO_SLUGS",
"LEGACY_PACKAGE_NAMES",
"LEGACY_PLUGIN_GROUP_NAMESPACES",
"DESKTOP_OUTPUT_MIRROR_DIR_NAME",
"DISTRIBUTION_NAME",
+ "DISTRIBUTION_NAMES",
+ "LEGACY_DISTRIBUTION_NAMES",
"FALLBACK_USER_DATA_DIR_NAME",
"FISH_CONF_FILE_NAME",
"KEYRING_SERVICE_NAME",
"LAUNCHER_ENTRY_NAME",
+ "LEGACY_KEYRING_SERVICE_NAMES",
+ "LEGACY_LINUX_APP_NAMES",
+ "LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES",
+ "LEGACY_LINUX_WM_CLASSES",
"LINUX_APP_NAME",
"LINUX_DESKTOP_ENTRY_FILE_NAME",
"LINUX_WM_CLASS",
"LEGACY_MARKETPLACE_EXTENSION_NAMESPACES",
"MARKETPLACE_EXTENSION_NAMESPACE",
"MACOS_APP_DIR_NAME",
+ "MACOS_APP_DIR_NAMES",
"MACOS_APP_NAME",
"MACOS_AUTOSTART_LABEL",
"MACOS_BUNDLE_ID",
@@ -215,10 +347,12 @@ __all__ = [
"MACOS_EXECUTABLE_NAME",
"MACOS_SIGNING_IDENTITY_LABEL",
"MANAGED_INSTALL_MARKER",
+ "MANAGED_INSTALL_MARKERS",
"MCP_AGENTS_SERVER_NAME",
"MCP_TOOLS_SERVER_NAME",
"LEGACY_MCP_AGENTS_SERVER_NAMES",
"LEGACY_MCP_TOOLS_SERVER_NAMES",
+ "OBSIDIAN_VAULT_FOLDER_NAME",
"OFFICIAL_RELEASES_LATEST_API_URL",
"OFFICIAL_REPO_GIT_URL",
"OFFICIAL_REPO_SLUG",
diff --git a/dodaios/core/config.py b/dodaios/core/config.py
index 2a8159af2a..b3c6c1488b 100644
--- a/dodaios/core/config.py
+++ b/dodaios/core/config.py
@@ -42,8 +42,9 @@ from dodaios.speech.wake_constants import DEFAULT_WAKE_PHRASE, WAKE_ENGINES
# as safe here as wake_constants.
from dodaios.ui.pets.states import DEFAULT_PET_ID
-from .branding import CONFIG_FILE_NAME, KEYRING_SERVICE_NAME
+from .branding import KEYRING_SERVICE_NAME, LEGACY_KEYRING_SERVICE_NAMES
from .env_prefix import accepted_names
+from .identity_boot import resolve_config_file
from .instance import current_instance, resolve_data_dir
from .protocols import RiskTier
@@ -61,7 +62,10 @@ if TYPE_CHECKING:
# ----------------------------------------------------------------------
PROJECT_ROOT = Path(__file__).resolve().parents[2]
-DEFAULT_CONFIG_FILE = PROJECT_ROOT / CONFIG_FILE_NAME
+# ``jarvis.toml`` while the checkout has one (it is never renamed), else
+# ``dodaios.toml``: resolved once, like every other path constant here, so the
+# reader and every writer in ``config_writer`` address the same file (AP-7).
+DEFAULT_CONFIG_FILE = resolve_config_file(PROJECT_ROOT)
PROFILES_DIR = PROJECT_ROOT / "profiles"
@@ -132,7 +136,11 @@ def _resolve_writable_data_dir() -> Path:
def resolve_config_path() -> Path:
- """Return the active ``jarvis.toml`` path, honouring ``JARVIS_CONFIG``.
+ """Return the active config file path, honouring ``JARVIS_CONFIG``.
+
+ Without the override it is :data:`DEFAULT_CONFIG_FILE`: the checkout's
+ ``jarvis.toml`` while one exists, else ``dodaios.toml``
+ (:func:`dodaios.core.identity_boot.resolve_config_file`).
Cloud-first: a headless ``python:3.11-slim`` container (or any VPS where
``PROJECT_ROOT`` is read-only / does not exist) sets ``JARVIS_CONFIG`` to a
@@ -147,6 +155,15 @@ def resolve_config_path() -> Path:
KEYRING_SERVICE = KEYRING_SERVICE_NAME
+# Services earlier versions filed credentials under. ``get_secret`` reads them
+# when the current service holds nothing for a slot (many slot names are only
+# known at runtime, so a one-time copy can never be complete), ``delete_secret``
+# clears them too (or a deleted key would come back through that read), and
+# ``set_secret`` refreshes an entry that already exists there so a downgrade
+# reads the new value. Nothing else ever writes to them.
+LEGACY_KEYRING_SERVICES: tuple[str, ...] = tuple(
+ service for service in LEGACY_KEYRING_SERVICE_NAMES if service != KEYRING_SERVICE_NAME
+)
# Provider-secrets are intentionally kept out of TOML. Keep the accepted
# Credential-Manager slots and ENV fallbacks in one place so pre-boot checks,
@@ -5524,6 +5541,11 @@ class _FileCredStore:
data.pop(self._k(service, username), None)
self._save(data)
+ def usernames(self, service: str) -> tuple[str, ...]:
+ """Every entry name stored under ``service`` (this store, unlike an OS one, can list)."""
+ prefix = self._k(service, "")
+ return tuple(name[len(prefix) :] for name in self._load() if name.startswith(prefix))
+
def _is_platform_keyring_backend(backend: Any) -> bool:
"""Return whether *backend* is a real platform credential-store candidate."""
@@ -5780,6 +5802,108 @@ def try_recover_platform_credential_store() -> bool:
return True
+def _peek_password(backend: Any, service: str, key: str) -> str | None:
+ """Read one entry without letting the backend write anything on the way.
+
+ The macOS vault wrapper folds a per-item entry it finds into the vault on a
+ normal read; ``peek_password`` is its read-only twin. Every other backend
+ only reads in ``get_password``.
+ """
+ peek = getattr(backend, "peek_password", None)
+ if callable(peek):
+ return peek(service, key)
+ return backend.get_password(service, key)
+
+
+def _read_legacy_secret(key: str) -> tuple[str | None, str | None]:
+ """``(platform value, file value)`` of ``key`` under the first legacy service holding it.
+
+ Mirrors the current-service read in ``get_secret`` (the platform backend,
+ and the 0600 file store next to it) without ever writing, and without
+ degrading the process to the file backend when a legacy read fails: the
+ current service answered, so the store itself is usable.
+ """
+ for service in LEGACY_KEYRING_SERVICES:
+ file_val: str | None = None
+ try:
+ file_val = _FileCredStore().get(service, key)
+ except Exception: # noqa: BLE001, S110 — unreadable fallback is absent
+ pass
+ platform_val: str | None = None
+ try:
+ import keyring
+
+ active_backend = keyring.get_keyring()
+ if getattr(active_backend, "_jarvis_file_backend", False):
+ # The active backend IS the file store read above; the platform
+ # copy, if any, lives in the retained backend.
+ platform_backend = _PLATFORM_KEYRING_BACKEND
+ if platform_backend is not None and _is_platform_keyring_backend(
+ platform_backend
+ ):
+ platform_val = _peek_password(platform_backend, service, key)
+ elif _is_platform_keyring_backend(active_backend):
+ # Through the module, like the current-service read above, so
+ # whatever the process routes ``keyring`` to is what answers.
+ peek = getattr(active_backend, "peek_password", None)
+ platform_val = (
+ peek(service, key) if callable(peek) else keyring.get_password(service, key)
+ )
+ except Exception as exc: # noqa: BLE001 — a legacy entry that cannot be read is absent
+ logging.getLogger(__name__).debug(
+ "legacy credential read for %s under %s failed (%s)",
+ key,
+ service,
+ type(exc).__name__,
+ )
+ if platform_val or file_val:
+ return platform_val, file_val
+ return None, None
+
+
+def _refresh_legacy_copies(key: str, value: str) -> None:
+ """Rewrite ``key`` under a legacy service where an entry already exists.
+
+ A transition measure: an install that goes back to a version that reads
+ only the legacy service must see the value saved last, not the one it
+ left behind. An entry is never created there, and a failure only costs
+ that downgrade the fresh value, so it is logged and never fails the save.
+ """
+ log = logging.getLogger(__name__)
+ for service in LEGACY_KEYRING_SERVICES:
+ try:
+ import keyring
+
+ backend = keyring.get_keyring()
+ if getattr(backend, "_jarvis_file_backend", False):
+ pass # the file store is refreshed below
+ else:
+ peek = getattr(backend, "peek_password", None)
+ existing = (
+ peek(service, key) if callable(peek) else keyring.get_password(service, key)
+ )
+ if existing is not None:
+ keyring.set_password(service, key, value)
+ except Exception as exc: # noqa: BLE001 — best effort, see the docstring
+ log.warning(
+ "legacy credential copy of %s under %s not refreshed (%s)",
+ key,
+ service,
+ type(exc).__name__,
+ )
+ try:
+ store = _FileCredStore()
+ if store.get(service, key) is not None:
+ store.set(service, key, value)
+ except Exception as exc: # noqa: BLE001 — best effort, see the docstring
+ log.warning(
+ "legacy file credential copy of %s under %s not refreshed (%s)",
+ key,
+ service,
+ type(exc).__name__,
+ )
+
+
def get_secret(key: str, env_fallback: str | None = None) -> str | None:
"""Retrieve a secret value from every portable credential source.
@@ -5788,6 +5912,10 @@ def get_secret(key: str, env_fallback: str | None = None) -> str | None:
while ENV and ``.env`` keep their documented precedence. This lets an
in-app save survive both a temporary keyring outage and the next restart.
+ A slot with no value under the current service is looked up under the
+ legacy services (``LEGACY_KEYRING_SERVICES``) next, at the same places in
+ that order, so a key saved before the service was renamed still beats ENV.
+
Args:
key: Secret name in the Credential Manager (e.g. "anthropic_api_key").
env_fallback: ENV variable checked when keyring is empty (e.g. "ANTHROPIC_API_KEY").
@@ -5845,6 +5973,13 @@ def get_secret(key: str, env_fallback: str | None = None) -> str | None:
except Exception: # noqa: BLE001, S110
pass
+ # Nothing under the current service: the slot may still sit under the name
+ # an earlier version filed it under. Its values take the places the current
+ # ones would have had, so a legacy OS-keyring value still beats ENV exactly
+ # as before the rename. Read-only: this path never writes either service.
+ if not platform_val and not file_val:
+ platform_val, file_val = _read_legacy_secret(key)
+
# Preserve OS-keyring-over-ENV precedence when this exact slot has no newer
# fallback value. When both copies exist, ENV/.env keep their documented
# precedence and the fallback copy beats only the stale OS copy.
@@ -6381,6 +6516,7 @@ def set_secret(key: str, value: str) -> bool:
return False
except Exception: # noqa: BLE001
return False
+ _refresh_legacy_copies(key, value)
_mark_secret_changed(key)
return True
except Exception as exc: # noqa: BLE001
@@ -6393,6 +6529,7 @@ def set_secret(key: str, value: str) -> bool:
import keyring
keyring.set_password(KEYRING_SERVICE, key, value)
+ _refresh_legacy_copies(key, value)
_mark_secret_changed(key)
return True
except Exception: # noqa: BLE001
@@ -6400,23 +6537,8 @@ def set_secret(key: str, value: str) -> bool:
return False
-def delete_secret(key: str) -> bool:
- """Remove a secret from both the OS keyring and local-file fallback.
-
- Success requires that NO backend still holds the value — deleting only
- the currently active backend can resurrect a stale fallback value on the
- next process start. The operation is intentionally idempotent: an
- already-absent key counts as a successful deletion.
-
- Unlike ``get_secret``/``set_secret``, a failed OS-keyring delete does NOT
- swap the process-global keyring backend to the file store. That retry
- used to let a transient/locked-keyring failure masquerade as a
- successful delete: the file copy (if any) was removed and ``True`` came
- back, while the real OS-keyring entry survived untouched and reappeared
- on the next boot. The ENV layer is read-only here and is never touched.
- """
- _ensure_keyring_backend()
-
+def _delete_secret_in(service: str, key: str) -> tuple[bool, bool]:
+ """Delete ``key`` under one service: ``(nothing is left there, a store confirmed it)``."""
# When a platform failure swapped this process onto the file backend, the
# retained platform store is a second live copy. Delete and verify it first.
# If that cannot be confirmed, leave the newer file copy intact: removing it
@@ -6427,13 +6549,13 @@ def delete_secret(key: str) -> bool:
from keyring.errors import PasswordDeleteError
try:
- retained_backend.delete_password(KEYRING_SERVICE, key)
+ retained_backend.delete_password(service, key)
except PasswordDeleteError:
pass
- if retained_backend.get_password(KEYRING_SERVICE, key) is not None:
- return False
+ if retained_backend.get_password(service, key) is not None:
+ return False, False
except Exception: # noqa: BLE001
- return False
+ return False, False
keyring_ok = False
try:
@@ -6441,7 +6563,7 @@ def delete_secret(key: str) -> bool:
from keyring.errors import PasswordDeleteError
try:
- keyring.delete_password(KEYRING_SERVICE, key)
+ keyring.delete_password(service, key)
except PasswordDeleteError:
# Every backend we rely on raises this specifically when the
# entry is already absent (e.g. the Windows Credential Manager
@@ -6451,7 +6573,7 @@ def delete_secret(key: str) -> bool:
# Some backends return success without deleting anything. Read the
# active backend back before removing a newer fallback copy or claiming
# that the secret is gone.
- keyring_ok = keyring.get_password(KEYRING_SERVICE, key) is None
+ keyring_ok = keyring.get_password(service, key) is None
except Exception: # noqa: BLE001
# A genuine backend failure (locked Secret Service, transport
# error, ...). Deliberately do not retry via
@@ -6466,19 +6588,45 @@ def delete_secret(key: str) -> bool:
# until the platform deletion can be confirmed; removing it here would
# immediately resurface the stale platform credential through
# ``get_secret`` and make a later retry impossible.
- return False
+ return False, False
file_ok = False
try:
store = _FileCredStore()
- if store.get(KEYRING_SERVICE, key) is not None:
- store.delete(KEYRING_SERVICE, key)
- file_ok = store.get(KEYRING_SERVICE, key) is None
+ if store.get(service, key) is not None:
+ store.delete(service, key)
+ file_ok = store.get(service, key) is None
except Exception: # noqa: BLE001, S110
pass
- if keyring_ok or file_ok:
+ return keyring_ok and file_ok, keyring_ok or file_ok
+
+
+def delete_secret(key: str) -> bool:
+ """Remove a secret from both the OS keyring and local-file fallback.
+
+ Success requires that NO backend still holds the value — deleting only
+ the currently active backend can resurrect a stale fallback value on the
+ next process start. The operation is intentionally idempotent: an
+ already-absent key counts as a successful deletion.
+
+ Unlike ``get_secret``/``set_secret``, a failed OS-keyring delete does NOT
+ swap the process-global keyring backend to the file store. That retry
+ used to let a transient/locked-keyring failure masquerade as a
+ successful delete: the file copy (if any) was removed and ``True`` came
+ back, while the real OS-keyring entry survived untouched and reappeared
+ on the next boot. The ENV layer is read-only here and is never touched.
+
+ The key is deleted under the current service AND every legacy service:
+ ``get_secret`` reads a legacy entry when the current service has none, so
+ a copy left there would bring the deleted key straight back.
+ """
+ _ensure_keyring_backend()
+ results = [
+ _delete_secret_in(service, key) for service in (KEYRING_SERVICE, *LEGACY_KEYRING_SERVICES)
+ ]
+ if any(changed for _gone, changed in results):
_mark_secret_changed(key)
- return keyring_ok and file_ok
+ return all(gone for gone, _changed in results)
# ----------------------------------------------------------------------
diff --git a/dodaios/core/control_key.py b/dodaios/core/control_key.py
index aaec358cea..89e50a768f 100644
--- a/dodaios/core/control_key.py
+++ b/dodaios/core/control_key.py
@@ -42,7 +42,7 @@ from dodaios.core.branding import (
CONTROL_KEY_PREFIX as KEY_PREFIX,
)
from dodaios.core.branding import (
- MACOS_APP_NAME as _MACOS_APP_NAME,
+ MACOS_APP_DIR_NAMES as _MACOS_APP_DIR_NAMES,
)
from dodaios.core.branding import (
MACOS_BUNDLE_ID as _MACOS_BUNDLE_ID,
@@ -187,9 +187,11 @@ def _macos_app_identity_token() -> str | None:
executable = Path(str(bundle.executablePath() or "")).resolve()
# Both install locations are canonical: the installer prefers
# /Applications and falls back to ~/Applications (BUG-161, BUG-216).
+ # So is the bundle's earlier name, until the rename has reached it.
expected = {
- (root / f"{_MACOS_APP_NAME}.app").resolve()
+ (root / name).resolve()
for root in (Path("/Applications"), Path.home() / "Applications")
+ for name in _MACOS_APP_DIR_NAMES
}
executable_root = bundle_path / "Contents" / "MacOS"
if (
@@ -270,27 +272,34 @@ def _remove_macos_owner() -> None:
def _macos_keychain_item_exists() -> bool:
- """Check item attributes without requesting its protected secret data."""
+ """Check item attributes without requesting its protected secret data.
+
+ Looks under the current credential service and every legacy one: a key
+ saved before the service was renamed is still the item to adopt.
+ """
if sys.platform != "darwin":
return False
- try:
- result = subprocess.run(
- [
- "/usr/bin/security",
- "find-generic-password",
- "-s",
- cfg.KEYRING_SERVICE,
- "-a",
- KEYRING_SLOT,
- ],
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- check=False,
- timeout=3,
- )
- return result.returncode == 0
- except (OSError, subprocess.SubprocessError):
- return False
+ for service in (cfg.KEYRING_SERVICE, *cfg.LEGACY_KEYRING_SERVICES):
+ try:
+ result = subprocess.run(
+ [
+ "/usr/bin/security",
+ "find-generic-password",
+ "-s",
+ service,
+ "-a",
+ KEYRING_SLOT,
+ ],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ check=False,
+ timeout=3,
+ )
+ except (OSError, subprocess.SubprocessError):
+ continue
+ if result.returncode == 0:
+ return True
+ return False
def _platform_credential_store_active() -> bool:
diff --git a/dodaios/core/desktop_entry.py b/dodaios/core/desktop_entry.py
index 3884a04603..1666f28254 100644
--- a/dodaios/core/desktop_entry.py
+++ b/dodaios/core/desktop_entry.py
@@ -114,6 +114,40 @@ def exec_value(program: str, args: Iterable[str] = ()) -> str:
return escape_value(" ".join(tokens))
+def exec_program(value: str | None) -> str:
+ """The program an ``Exec=`` value starts: its first argument, decoded.
+
+ ``value`` is the raw field as :func:`read_field` returns it. Both layers
+ are unwound in reader order: the key-file escapes first, then the Exec
+ quoting (inside double quotes a backslash takes the next character
+ literally) and the ``%%`` doubling. An empty or missing value gives ``""``.
+ """
+ command = unescape_value(value or "").lstrip()
+ out: list[str] = []
+ index = 0
+ quoted = False
+ while index < len(command):
+ char = command[index]
+ if quoted:
+ if char == "\\" and index + 1 < len(command):
+ out.append(command[index + 1])
+ index += 2
+ continue
+ if char == '"':
+ quoted = False
+ index += 1
+ continue
+ elif char == '"':
+ quoted = True
+ index += 1
+ continue
+ elif char in " \t\n":
+ break
+ out.append(char)
+ index += 1
+ return "".join(out).replace("%%", "%")
+
+
def read_field(text: str, key: str, *, group: str = DESKTOP_ENTRY_GROUP) -> str | None:
"""The raw (still key-file-escaped) value of ``key`` in ``group``, or ``None``.
@@ -159,6 +193,7 @@ __all__ = [
"DESKTOP_ENTRY_GROUP",
"escape_value",
"exec_argument",
+ "exec_program",
"exec_value",
"read_field",
"reads_as_false",
diff --git a/dodaios/core/distribution.py b/dodaios/core/distribution.py
new file mode 100644
index 0000000000..1f0b7669b2
--- /dev/null
+++ b/dodaios/core/distribution.py
@@ -0,0 +1,123 @@
+"""Warn once when one environment holds the app under both distribution names.
+
+The Python distribution was renamed (``dodaios.core.branding``:
+``LEGACY_DISTRIBUTION_NAMES`` -> ``DISTRIBUTION_NAME``). For a transition the
+same code is published under both names, so both own the same package files.
+With both installed the app runs fine, but uninstalling either one later
+deletes files the other still needs. ``install/installer.py`` never creates
+that state (it uninstalls the earlier name first); a manual ``pip install``
+can, and this check names the fix.
+
+Off the boot path (AP-26): :func:`schedule_duplicate_distribution_check`
+starts one daemon thread a while after the server is up, once per process,
+and only outside a frozen build, whose bundle carries one record by
+construction. The check reads package metadata and logs one line at most.
+"""
+
+from __future__ import annotations
+
+import logging
+import os
+import sys
+import threading
+import time
+from collections.abc import Callable, Mapping, Sequence
+from importlib import metadata
+
+from dodaios.core.branding import DISTRIBUTION_NAME, DISTRIBUTION_NAMES
+
+log = logging.getLogger(__name__)
+
+# The boot is long over by then: the check competes with nothing in use.
+DEFAULT_DELAY_S = 30.0
+PRIMARY_INSTANCE_ENV_VAR = "JARVIS_PRIMARY_INSTANCE"
+
+_SCHEDULE_LOCK = threading.Lock()
+_scheduled = False
+
+
+def _is_installed(name: str) -> bool:
+ try:
+ metadata.distribution(name)
+ except metadata.PackageNotFoundError:
+ # Not installed under this name: that is the answer, not a failure.
+ return False
+ return True
+
+
+def installed_distribution_names(
+ names: Sequence[str] = DISTRIBUTION_NAMES,
+ *,
+ is_installed: Callable[[str], bool] = _is_installed,
+) -> tuple[str, ...]:
+ """Which of the distribution's names this environment has installed."""
+ return tuple(name for name in names if is_installed(name))
+
+
+def duplicate_distribution_message(installed: Sequence[str]) -> str | None:
+ """The warning for ``installed``, or ``None`` when it holds at most one name."""
+ if len(installed) < 2:
+ return None
+ others = [name for name in installed if name != DISTRIBUTION_NAME]
+ return (
+ f"The Python packages {' and '.join(installed)} are both installed in {sys.prefix}. "
+ "They contain the same files, so uninstalling one later deletes files the "
+ f"other needs. Run: pip uninstall -y {' '.join(others)} && "
+ f"pip install --force-reinstall --no-deps {DISTRIBUTION_NAME} "
+ "(an install from the one-line installer: run the installer again)."
+ )
+
+
+def check_duplicate_distributions(
+ *, is_installed: Callable[[str], bool] = _is_installed
+) -> str | None:
+ """Log the warning when it applies; return it for callers and tests."""
+ message = duplicate_distribution_message(
+ installed_distribution_names(is_installed=is_installed)
+ )
+ if message:
+ log.warning(message)
+ return message
+
+
+def _run(delay_s: float) -> None:
+ if delay_s > 0:
+ time.sleep(delay_s)
+ try:
+ check_duplicate_distributions()
+ except Exception: # noqa: BLE001 - a diagnostic must never take the app down
+ log.debug("Duplicate distribution check failed.", exc_info=True)
+
+
+def schedule_duplicate_distribution_check(
+ *,
+ delay_s: float = DEFAULT_DELAY_S,
+ environ: Mapping[str, str] | None = None,
+) -> threading.Thread | None:
+ """Start the check in a daemon thread, once per process; ``None`` when skipped.
+
+ Main instance only (``JARVIS_PRIMARY_INSTANCE=1``, set by the launcher that
+ holds the single-instance lock), like the other one-time background jobs.
+ """
+ global _scheduled
+ env = os.environ if environ is None else environ
+ if getattr(sys, "frozen", False) or env.get(PRIMARY_INSTANCE_ENV_VAR) != "1":
+ return None
+ with _SCHEDULE_LOCK:
+ if _scheduled:
+ return None
+ _scheduled = True
+ thread = threading.Thread(
+ target=_run, args=(delay_s,), name="distribution-check", daemon=True
+ )
+ thread.start()
+ return thread
+
+
+__all__ = [
+ "DEFAULT_DELAY_S",
+ "check_duplicate_distributions",
+ "duplicate_distribution_message",
+ "installed_distribution_names",
+ "schedule_duplicate_distribution_check",
+]
diff --git a/dodaios/core/frozen.py b/dodaios/core/frozen.py
index 299b9b0714..75d3690c9b 100644
--- a/dodaios/core/frozen.py
+++ b/dodaios/core/frozen.py
@@ -8,7 +8,8 @@ Three install kinds exist, and each one ships a different update path:
Updates arrive as a new installer asset from the GitHub Release, never
through git.
* ``managed`` — the one-line installer's git checkout under
- ``~/.personal-jarvis`` (marker file + official origin; the probe lives in
+ ``~/.dodaios``, or ``~/.personal-jarvis`` for an install not moved yet
+ (marker file + official origin; the probe lives in
``dodaios/ui/web/update_routes.py``). Updates are ``git fetch`` + reinstall.
* ``dev`` — anything else: a maintainer checkout, a fork, a plain
``pip install``. Never self-updates.
diff --git a/dodaios/core/identity_boot.py b/dodaios/core/identity_boot.py
new file mode 100644
index 0000000000..e70091a859
--- /dev/null
+++ b/dodaios/core/identity_boot.py
@@ -0,0 +1,455 @@
+"""Find, and at the primary instance's start move, the directories named by persistent identity.
+
+``dodaios.core.branding`` names the per-user data directory and the config
+file. Their names changed once, and an existing installation still has its
+data under the earlier name. Two things follow, and this module holds both:
+
+* **Resolution, everywhere.** Any process (helpers, the CLI, the desktop app)
+ asks :func:`user_data_dir_pair` / :func:`resolve_pair` where a directory is.
+ The legacy directory wins while it is a real directory, not a link; otherwise
+ the current name is used. The answer costs a few ``stat`` calls (AP-26) and
+ is cached per process; :func:`reset_resolution_cache` clears it.
+* **Migration, once, by the primary instance only.** :func:`migrate_at_boot`
+ runs in the source launcher right after the instance is chosen and before
+ anything opens a file in the data directory. It moves the legacy directory
+ with one rename and leaves a junction (Windows) or symlink behind
+ (``dodaios.core.identity_migration``); nothing is ever copied and deleted. A
+ refused rename leaves everything where it was and the app runs from the
+ legacy directory, which stays a fully valid state.
+ The frozen build does the same in its runtime hook
+ (``packaging/pyinstaller_rthook_frozen.py``), which cannot import the package.
+
+The config file is never renamed: :func:`resolve_config_file` keeps an existing
+legacy file in use for good, and only an installation that has none gets the
+current name.
+
+Standard library plus ``dodaios.core.branding`` / ``instance`` /
+``identity_migration``, all import-light: the launcher imports this before the
+config graph.
+"""
+
+from __future__ import annotations
+
+import logging
+import os
+import sys
+import threading
+from collections.abc import Callable, Mapping, MutableMapping, Sequence
+from dataclasses import dataclass
+from pathlib import Path
+
+from dodaios.core.branding import (
+ CONFIG_FILE_NAME,
+ FALLBACK_USER_DATA_DIR_NAME,
+ LEGACY_CONFIG_FILE_NAMES,
+ LEGACY_FALLBACK_USER_DATA_DIR_NAMES,
+ LEGACY_WINDOWS_MUTEX_NAMES,
+ LEGACY_WINDOWS_USER_DATA_DIR_NAMES,
+ WINDOWS_MUTEX_NAME,
+ WINDOWS_USER_DATA_DIR_NAME,
+)
+from dodaios.core.identity_migration import (
+ DirectoryMigration,
+ DirectoryOutcome,
+ LegacyState,
+ default_lock_path,
+ inspect_legacy,
+ lock_file_held,
+ migrate_directory,
+ named_mutex_exists,
+ resolve_directory,
+)
+from dodaios.core.instance import (
+ DEFAULT_INSTANCE_NAME,
+ INSTANCE_ENV_VAR,
+ KNOWN_INSTANCE_NAMES,
+ InstanceNameError,
+ normalize_instance_name,
+)
+
+log = logging.getLogger(__name__)
+
+#: How long the primary waits for another migrator before it only resolves. A
+#: caller that goes on to create directories must not resolve in the instant
+#: between that migrator's rename and its link.
+MIGRATION_WAIT_SECONDS = 2.0
+
+#: The variable the frozen runtime hook leaves its one-line report in
+#: (``level|message``); the launcher logs it once a sink exists.
+HOOK_REPORT_ENV_VAR = "JARVIS_IDENTITY_MIGRATION_REPORT"
+
+#: Lock files a running primary of any release holds inside the data
+#: directory: the POSIX single-instance claim (``dodaios.ui.shell.single_instance``)
+#: and the launcher lock of a frozen build, whose runtime data sits in ``data/``.
+PRIMARY_LOCK_FILES: tuple[str, ...] = ("instance.lock", os.path.join("data", "jarvis.lock"))
+
+#: Outcomes that are the ordinary start, not worth a log line.
+_QUIET_OUTCOMES = frozenset({DirectoryOutcome.NOTHING_TO_MIGRATE, DirectoryOutcome.ALREADY_LINKED})
+
+
+@dataclass(frozen=True, slots=True)
+class DirectoryPair:
+ """A directory under its current name and the earlier names it may still have."""
+
+ current: Path
+ legacy: tuple[Path, ...] = ()
+
+
+def named_pair(parent: Path, name: str, legacy_names: Sequence[str]) -> DirectoryPair:
+ """``parent/name`` with ``parent/<legacy>`` for each earlier name."""
+ return DirectoryPair(parent / name, tuple(parent / legacy for legacy in legacy_names))
+
+
+def user_data_dir_pair(environ: Mapping[str, str] | None = None) -> DirectoryPair:
+ """The per-user data directory: ``%LOCALAPPDATA%\\Dodaios`` or ``~/.dodaios-data``.
+
+ An exported-but-empty ``LOCALAPPDATA`` is not a directory, so it falls back
+ to the home directory like an absent one.
+ """
+ source = os.environ if environ is None else environ
+ base = source.get("LOCALAPPDATA")
+ if base:
+ return named_pair(
+ Path(base), WINDOWS_USER_DATA_DIR_NAME, LEGACY_WINDOWS_USER_DATA_DIR_NAMES
+ )
+ return named_pair(Path.home(), FALLBACK_USER_DATA_DIR_NAME, LEGACY_FALLBACK_USER_DATA_DIR_NAMES)
+
+
+def data_dir_pairs(environ: Mapping[str, str] | None = None) -> tuple[DirectoryPair, ...]:
+ """Every directory the primary instance moves to its current name at boot.
+
+ Only the data directory. Folders a person opens themselves (the Desktop
+ output mirror, the deliverables folder) are resolved, never moved: a link
+ left behind on the Desktop would show the same folder twice.
+ """
+ return (user_data_dir_pair(environ),)
+
+
+# ----------------------------------------------------------------------
+# Resolution
+# ----------------------------------------------------------------------
+
+_cache_lock = threading.Lock()
+_resolved: dict[DirectoryPair, Path] = {}
+
+
+def resolve_pair(pair: DirectoryPair) -> Path:
+ """The directory to use for ``pair``: a legacy one while it is a real directory.
+
+ Read-only and cached per process by the exact paths asked about, so a test
+ that points ``LOCALAPPDATA`` or the home directory elsewhere gets a fresh
+ answer without clearing anything.
+ """
+ with _cache_lock:
+ cached = _resolved.get(pair)
+ if cached is not None:
+ return cached
+ resolved = resolve_directory(pair.current, pair.legacy) if pair.legacy else pair.current
+ with _cache_lock:
+ _resolved[pair] = resolved
+ return resolved
+
+
+def reset_resolution_cache() -> None:
+ """Forget every resolved directory; the next call reads the filesystem again."""
+ with _cache_lock:
+ _resolved.clear()
+
+
+def resolve_named_dir(parent: Path, name: str, legacy_names: Sequence[str]) -> Path:
+ """Resolve ``parent/name`` against its earlier names (see :func:`resolve_pair`)."""
+ return resolve_pair(named_pair(parent, name, legacy_names))
+
+
+def data_dir_spellings(path: str | os.PathLike[str]) -> tuple[Path, ...]:
+ """``path`` under every name the per-user data directory has had.
+
+ ``(path,)`` when it lies outside the data directory; otherwise ``path``
+ first, then the same location under each other name. Purely lexical (no
+ filesystem access): a path stored before the move spells the old name, one
+ computed after it the new one, and after the move both reach the same file
+ through the link left behind. Text comparisons of paths that may come from
+ either side compare against every spelling.
+ """
+ pair = user_data_dir_pair()
+ absolute = os.path.abspath(os.fspath(path))
+ folded = os.path.normcase(absolute)
+ roots = (pair.current, *pair.legacy)
+ for root in roots:
+ root_text = os.path.abspath(os.fspath(root))
+ root_folded = os.path.normcase(root_text)
+ if folded != root_folded and not folded.startswith(root_folded.rstrip(os.sep) + os.sep):
+ continue
+ rest = absolute[len(root_text) :].lstrip("\\/")
+ spellings = [Path(absolute)]
+ for other in roots:
+ if other != root:
+ other_root = Path(os.path.abspath(os.fspath(other)))
+ spellings.append(other_root / rest if rest else other_root)
+ return tuple(spellings)
+ return (Path(absolute),)
+
+
+def stable_data_dir_spelling(path: str | os.PathLike[str]) -> Path:
+ """``path`` spelled under the data directory's earliest name when it lies inside it.
+
+ For identifiers derived from a path (a hash, a key): one computed after the
+ move then equals one stored before it. Outside the data directory the
+ path is returned unchanged (made absolute).
+ """
+ pair = user_data_dir_pair()
+ spellings = data_dir_spellings(path)
+ if len(spellings) == 1 or not pair.legacy:
+ return spellings[0]
+ earliest = os.path.normcase(os.path.abspath(os.fspath(pair.legacy[-1])))
+ for spelling in spellings:
+ folded = os.path.normcase(str(spelling))
+ if folded == earliest or folded.startswith(earliest.rstrip(os.sep) + os.sep):
+ return spelling
+ return spellings[0]
+
+
+def resolve_config_file(root: str | os.PathLike[str]) -> Path:
+ """The config file in ``root``: a legacy-named file while it exists, else the current name.
+
+ The file is never renamed. An installation that has a ``jarvis.toml`` keeps
+ it as its configuration; one that has none (a fresh install) gets
+ ``dodaios.toml``. One ``stat`` per legacy name.
+ """
+ folder = Path(root)
+ for legacy in LEGACY_CONFIG_FILE_NAMES:
+ candidate = folder / legacy
+ if candidate.is_file():
+ return candidate
+ return folder / CONFIG_FILE_NAME
+
+
+def config_file_names() -> tuple[str, ...]:
+ """Every name the config file may have, in the order :func:`resolve_config_file` tries."""
+ return (*LEGACY_CONFIG_FILE_NAMES, CONFIG_FILE_NAME)
+
+
+# ----------------------------------------------------------------------
+# Migration at boot
+# ----------------------------------------------------------------------
+
+
+@dataclass(frozen=True, slots=True)
+class MigrationDecision:
+ """Whether this process may move directories, and why (for the log)."""
+
+ allowed: bool
+ reason: str
+
+ def __bool__(self) -> bool:
+ return self.allowed
+
+
+def primary_mutex_names() -> tuple[str, ...]:
+ """Mutex names a running desktop app of this or an earlier release holds.
+
+ Every instance counts, the dev app included: it shares the per-user data
+ directory with the default app.
+ """
+ names: list[str] = []
+ for base in (WINDOWS_MUTEX_NAME, *LEGACY_WINDOWS_MUTEX_NAMES):
+ names.append(base)
+ names.extend(
+ f"{base}_{name}" for name in KNOWN_INSTANCE_NAMES if name != DEFAULT_INSTANCE_NAME
+ )
+ return tuple(names)
+
+
+def primary_lock_files(pairs: Sequence[DirectoryPair]) -> tuple[Path, ...]:
+ """The primary-instance lock files inside every legacy directory of ``pairs``."""
+ return tuple(
+ legacy / name for pair in pairs for legacy in pair.legacy for name in PRIMARY_LOCK_FILES
+ )
+
+
+def migration_pending(pairs: Sequence[DirectoryPair]) -> bool:
+ """True when a legacy directory still holds data, or a move is unfinished.
+
+ The ordinary start answers False with a couple of ``stat`` calls and no
+ instance probe (AP-26).
+ """
+ for pair in pairs:
+ if pair.legacy and os.path.lexists(default_lock_path(pair.current)):
+ return True
+ for legacy in pair.legacy:
+ if inspect_legacy(legacy, pair.current) is LegacyState.REAL_DIRECTORY:
+ return True
+ return False
+
+
+def may_migrate(
+ argv: Sequence[str],
+ *,
+ environ: Mapping[str, str] | None = None,
+ frozen: bool | None = None,
+ platform: str | None = None,
+ pairs: Sequence[DirectoryPair] | None = None,
+ mutex_exists: Callable[[Sequence[str]], bool] = named_mutex_exists,
+ lock_held: Callable[[Sequence[Path]], bool] = lock_file_held,
+) -> MigrationDecision:
+ """True only for the main instance: default instance, with the lock, nothing else running.
+
+ The main instance is the default instance started without ``--no-lock``,
+ and no primary is running: on Windows no single-instance mutex exists
+ under any name it has had; elsewhere nobody holds a lock file in a legacy
+ directory (the file is opened, never created). A frozen build answers
+ False here because its runtime hook already made the same decision before
+ the package was importable.
+ """
+ source = os.environ if environ is None else environ
+ is_frozen = bool(getattr(sys, "frozen", False)) if frozen is None else frozen
+ if is_frozen:
+ return MigrationDecision(False, "frozen build: the runtime hook migrates")
+ try:
+ instance = normalize_instance_name(source.get(INSTANCE_ENV_VAR))
+ except InstanceNameError:
+ # The launcher reports the bad name and exits; here it only means no move.
+ return MigrationDecision(False, f"unknown {INSTANCE_ENV_VAR}")
+ if instance != DEFAULT_INSTANCE_NAME:
+ return MigrationDecision(False, f"instance {instance!r} only resolves")
+ if "--no-lock" in argv:
+ return MigrationDecision(False, "--no-lock run only resolves")
+ os_name = sys.platform if platform is None else platform
+ if os_name == "win32":
+ if mutex_exists(primary_mutex_names()):
+ return MigrationDecision(False, "a primary instance is running")
+ return MigrationDecision(True, "no primary instance holds the mutex")
+ checked = data_dir_pairs(source) if pairs is None else pairs
+ if lock_held(primary_lock_files(checked)):
+ return MigrationDecision(False, "a primary instance holds its lock file")
+ return MigrationDecision(True, "no primary instance holds a lock file")
+
+
+def migrate_data_dirs(
+ pairs: Sequence[DirectoryPair] | None = None,
+ *,
+ wait_seconds: float = MIGRATION_WAIT_SECONDS,
+ migrate: Callable[..., DirectoryMigration] = migrate_directory,
+) -> tuple[DirectoryMigration, ...]:
+ """Move every legacy directory of ``pairs`` to its current name. Never raises ``OSError``.
+
+ The caller has established that it is the main instance. The resolution
+ cache is cleared afterwards, so every later lookup sees the result.
+ """
+ results: list[DirectoryMigration] = []
+ try:
+ for pair in data_dir_pairs() if pairs is None else pairs:
+ for legacy in pair.legacy:
+ results.append(migrate(legacy, pair.current, wait_seconds=wait_seconds))
+ finally:
+ reset_resolution_cache()
+ return tuple(results)
+
+
+#: Outcomes after which the data is under the current name.
+_MOVED_OUTCOMES = frozenset({DirectoryOutcome.MIGRATED, DirectoryOutcome.LINK_RESTORED})
+
+
+@dataclass(frozen=True, slots=True)
+class BootReport:
+ """The one log line a boot migration leaves, and its level."""
+
+ level: str
+ message: str
+
+
+def describe(results: Sequence[DirectoryMigration]) -> BootReport | None:
+ """One log line for what the migration did, or ``None`` for an ordinary start.
+
+ INFO when everything that was found moved, WARNING when something stayed
+ under its earlier name (it is still in use there, which works, but the
+ reason belongs in the log).
+ """
+ notable = [result for result in results if result.outcome not in _QUIET_OUTCOMES]
+ if not notable:
+ return None
+ parts = []
+ for result in notable:
+ text = (
+ f"{result.legacy} -> {result.current}: {result.outcome.value}, using {result.effective}"
+ )
+ if result.detail:
+ text += f" ({result.detail})"
+ parts.append(text)
+ moved = all(result.outcome in _MOVED_OUTCOMES for result in notable)
+ return BootReport(
+ "INFO" if moved else "WARNING", "Data directory migration: " + "; ".join(parts)
+ )
+
+
+def take_hook_report(environ: MutableMapping[str, str] | None = None) -> BootReport | None:
+ """The report the frozen runtime hook left in the environment, removed from it.
+
+ Removed so that no child process inherits it and logs it a second time.
+ """
+ source = os.environ if environ is None else environ
+ raw = source.pop(HOOK_REPORT_ENV_VAR, None)
+ if not raw:
+ return None
+ level, separator, message = raw.partition("|")
+ if not separator or level not in ("INFO", "WARNING") or not message:
+ return BootReport("WARNING", raw)
+ return BootReport(level, message)
+
+
+def migrate_at_boot(argv: Sequence[str]) -> BootReport | None:
+ """The launcher's hook: migrate when this is the main instance, else only resolve.
+
+ Returns the line to log once the log sink exists (this runs before it),
+ or ``None`` when there is nothing to say. In a frozen build that is the
+ runtime hook's report. No exception escapes: a failed migration leaves the
+ app running from the legacy directory.
+ """
+ hook_report = take_hook_report()
+ if hook_report is not None:
+ return hook_report
+ try:
+ pairs = data_dir_pairs()
+ if not migration_pending(pairs):
+ return None
+ decision = may_migrate(argv, pairs=pairs)
+ if not decision:
+ log.debug("Data directory migration skipped: %s.", decision.reason)
+ return None
+ return describe(migrate_data_dirs(pairs))
+ except Exception as exc: # noqa: BLE001 - boot continues at the legacy path; reported
+ log.warning("Data directory migration failed; continuing where the data is.", exc_info=True)
+ reset_resolution_cache()
+ return BootReport(
+ "WARNING",
+ f"Data directory migration failed ({type(exc).__name__}: {exc}); "
+ "running from the directory that holds the data now.",
+ )
+
+
+__all__ = [
+ "HOOK_REPORT_ENV_VAR",
+ "MIGRATION_WAIT_SECONDS",
+ "PRIMARY_LOCK_FILES",
+ "BootReport",
+ "DirectoryPair",
+ "MigrationDecision",
+ "config_file_names",
+ "data_dir_pairs",
+ "data_dir_spellings",
+ "describe",
+ "may_migrate",
+ "migrate_at_boot",
+ "migrate_data_dirs",
+ "migration_pending",
+ "named_pair",
+ "primary_lock_files",
+ "primary_mutex_names",
+ "reset_resolution_cache",
+ "resolve_config_file",
+ "resolve_named_dir",
+ "resolve_pair",
+ "stable_data_dir_spelling",
+ "take_hook_report",
+ "user_data_dir_pair",
+]
diff --git a/dodaios/core/identity_credentials.py b/dodaios/core/identity_credentials.py
new file mode 100644
index 0000000000..0bf1a17343
--- /dev/null
+++ b/dodaios/core/identity_credentials.py
@@ -0,0 +1,289 @@
+"""Copy stored credentials from the legacy keyring service to the current one, once.
+
+The credential-store service was renamed (``dodaios.core.branding``:
+``LEGACY_KEYRING_SERVICE_NAMES`` -> ``KEYRING_SERVICE_NAME``). Nothing depends
+on this copy for correctness: ``dodaios.core.config.get_secret`` reads the
+legacy service whenever the current one has no value for a slot, and
+``delete_secret`` clears both. The copy only lets most reads stop at the
+current service, and it is what eventually leaves the legacy entries as
+nothing more than the way back for a downgrade.
+
+How it runs (AP-26): :func:`schedule_credential_migration` starts one daemon
+thread, in the main instance only, a while after the server is up. The
+thread copies through :func:`dodaios.core.identity_migration.migrate_keyring`
+(never overwrites a current value, never deletes a legacy one, reads every
+copy back, writes a ``__migrated_from__<legacy>`` marker so a later start
+skips the work) over each store ``get_secret`` reads:
+
+* the platform store (Windows Credential Manager, Secret Service, macOS
+ Keychain). On macOS every key lives in one vault entry, so the vault is
+ copied in one write (``DarwinBundleKeyringBackend.copy_vault``) instead of
+ rewriting it once per key, and the user sees no prompt per key;
+* the 0600 file fallback, which can list its own entries.
+
+A process that never runs it (a second instance, a CLI, a test) loses
+nothing, and a run cut short is simply finished by the next start.
+"""
+
+from __future__ import annotations
+
+import logging
+import os
+import threading
+import time
+from collections.abc import Iterable, Mapping
+from dataclasses import dataclass
+from typing import Any
+
+from dodaios.core.identity_migration import (
+ KeyringMigration,
+ KeyringOutcome,
+ keyring_marker_key,
+ migrate_keyring,
+)
+
+log = logging.getLogger(__name__)
+
+# Long enough that the voice and UI boot is over before the first credential
+# read of the copy: it competes with nothing the user is waiting for.
+DEFAULT_DELAY_S = 20.0
+PRIMARY_INSTANCE_ENV_VAR = "JARVIS_PRIMARY_INSTANCE"
+
+_SCHEDULE_LOCK = threading.Lock()
+_scheduled = False
+
+
+@dataclass(frozen=True, slots=True)
+class StoreMigration:
+ """One store's part of a run. Key names only, never a value."""
+
+ store: str
+ legacy_service: str
+ current_service: str
+ outcome: str
+ copied: tuple[str, ...] = ()
+ kept: tuple[str, ...] = ()
+ failed: tuple[str, ...] = ()
+
+ @classmethod
+ def from_engine(cls, store: str, result: KeyringMigration) -> StoreMigration:
+ return cls(
+ store=store,
+ legacy_service=result.legacy_service,
+ current_service=result.current_service,
+ outcome=result.outcome.value,
+ copied=result.copied,
+ kept=result.kept,
+ failed=result.failed,
+ )
+
+
+class _LegacyReadOnly:
+ """A backend whose reads of the legacy service never write anything.
+
+ The macOS vault wrapper folds a per-item entry into the vault on a normal
+ read; through this view a legacy read is a ``peek`` and a write to the
+ legacy service is refused outright, so the copy cannot change the way back.
+ """
+
+ def __init__(self, backend: Any, legacy_service: str) -> None:
+ self._backend = backend
+ self._legacy = legacy_service
+
+ def get_password(self, service: str, key: str) -> str | None:
+ if service == self._legacy:
+ peek = getattr(self._backend, "peek_password", None)
+ if callable(peek):
+ return peek(service, key)
+ return self._backend.get_password(service, key)
+
+ def set_password(self, service: str, key: str, value: str) -> None:
+ if service == self._legacy:
+ raise PermissionError("the legacy credential service is never written by the copy")
+ self._backend.set_password(service, key, value)
+
+ def delete_password(self, service: str, key: str) -> None:
+ raise PermissionError("the credential copy never deletes")
+
+
+class _FileStoreKeyring:
+ """The 0600 file fallback in the ``keyring`` call shape."""
+
+ def __init__(self, store: Any) -> None:
+ self._store = store
+
+ def get_password(self, service: str, key: str) -> str | None:
+ return self._store.get(service, key)
+
+ def set_password(self, service: str, key: str, value: str) -> None:
+ self._store.set(service, key, value)
+
+ def delete_password(self, service: str, key: str) -> None:
+ self._store.delete(service, key)
+
+ def usernames(self, service: str) -> tuple[str, ...]:
+ return self._store.usernames(service)
+
+
+def _usable_platform_backend(cfg: Any) -> Any | None:
+ """The live OS credential store, or ``None`` when the process runs on the file store.
+
+ A process that fell back to the file store after a platform failure is not
+ a good moment to copy into the platform store: every write would fail.
+ The legacy entries stay readable through ``get_secret`` meanwhile.
+ """
+ try:
+ import keyring
+
+ backend = keyring.get_keyring()
+ except Exception as exc: # noqa: BLE001 — no keyring module: nothing to copy there
+ log.info("Credential copy: no OS credential store (%s).", type(exc).__name__)
+ return None
+ if getattr(backend, "_jarvis_file_backend", False):
+ return None
+ return backend if cfg._is_platform_keyring_backend(backend) else None
+
+
+def _migrate_platform(
+ backend: Any, legacy: str, current: str, keys: set[str]
+) -> list[StoreMigration]:
+ results: list[StoreMigration] = []
+ marker = keyring_marker_key(legacy)
+ copy_vault = getattr(backend, "copy_vault", None)
+ if callable(copy_vault):
+ vault = copy_vault(legacy, current, marker=marker)
+ outcome = getattr(vault.outcome, "value", str(vault.outcome))
+ results.append(
+ StoreMigration("keychain-vault", legacy, current, outcome, copied=vault.copied)
+ )
+ if outcome in {"copied", "already_copied"}:
+ return results
+ # No usable legacy vault: entries may still exist one item each, from
+ # before the vault existed. Its keys, if it could be read, join the list.
+ stored_keys = getattr(backend, "stored_keys", None)
+ if callable(stored_keys):
+ keys = keys | set(stored_keys(legacy))
+ result = migrate_keyring(
+ _LegacyReadOnly(backend, legacy),
+ legacy_service=legacy,
+ current_service=current,
+ keys=sorted(keys),
+ )
+ results.append(StoreMigration.from_engine("platform", result))
+ return results
+
+
+def _migrate_file_store(cfg: Any, legacy: str, current: str) -> StoreMigration | None:
+ store = _FileStoreKeyring(cfg._FileCredStore())
+ try:
+ legacy_keys = store.usernames(legacy)
+ except Exception as exc: # noqa: BLE001 — an unreadable file store holds nothing to copy
+ log.warning("Credential copy: file store not readable (%s).", type(exc).__name__)
+ return None
+ if not legacy_keys:
+ # Nothing filed there under the old name: no marker either, so a
+ # machine that never used the file store does not get one created.
+ return None
+ result = migrate_keyring(
+ _LegacyReadOnly(store, legacy),
+ legacy_service=legacy,
+ current_service=current,
+ keys=sorted(legacy_keys),
+ )
+ return StoreMigration.from_engine("file", result)
+
+
+def migrate_credentials(*, keys: Iterable[str] | None = None) -> tuple[StoreMigration, ...]:
+ """Copy every legacy credential this install can name to the current service.
+
+ ``keys`` replaces the names from ``dodaios.core.secret_slots`` (tests).
+ Safe to call again: a store that carries the marker is skipped after one
+ read. Logs one summary line per store.
+ """
+ from dodaios.core import config as cfg
+
+ cfg._ensure_keyring_backend()
+ current = cfg.KEYRING_SERVICE
+ if keys is None:
+ from dodaios.core.secret_slots import all_secret_keys
+
+ names = set(all_secret_keys())
+ else:
+ names = set(keys)
+
+ results: list[StoreMigration] = []
+ for legacy in cfg.LEGACY_KEYRING_SERVICES:
+ platform = _usable_platform_backend(cfg)
+ if platform is not None:
+ results.extend(_migrate_platform(platform, legacy, current, names))
+ file_result = _migrate_file_store(cfg, legacy, current)
+ if file_result is not None:
+ results.append(file_result)
+
+ for result in results:
+ log.info(
+ "Credential copy %s -> %s (%s): %s, %d copied, %d already present, %d failed%s",
+ result.legacy_service,
+ result.current_service,
+ result.store,
+ result.outcome,
+ len(result.copied),
+ len(result.kept),
+ len(result.failed),
+ f" ({', '.join(result.failed)})" if result.failed else "",
+ )
+ if any(r.outcome == KeyringOutcome.INCOMPLETE.value for r in results):
+ log.info("Credential copy is retried on the next start; nothing is lost meanwhile.")
+ return tuple(results)
+
+
+def _run(delay_s: float) -> None:
+ if delay_s > 0:
+ time.sleep(delay_s)
+ try:
+ migrate_credentials()
+ except Exception: # noqa: BLE001 — a background copy must never take the app down
+ log.warning("Credential copy failed; legacy keys stay readable.", exc_info=True)
+
+
+def schedule_credential_migration(
+ *,
+ delay_s: float = DEFAULT_DELAY_S,
+ environ: Mapping[str, str] | None = None,
+) -> threading.Thread | None:
+ """Start the one-time copy in a daemon thread, main instance only, once per process.
+
+ Returns the thread, or ``None`` when this process does not run it: not the
+ main instance (``JARVIS_PRIMARY_INSTANCE`` is set to ``1`` only by the
+ launcher that holds the single-instance lock), already started, or no
+ legacy service to copy from.
+ """
+ global _scheduled
+ from dodaios.core import config as cfg
+
+ env = os.environ if environ is None else environ
+ if env.get(PRIMARY_INSTANCE_ENV_VAR) != "1":
+ log.debug("Credential copy not scheduled: not the main instance.")
+ return None
+ if not cfg.LEGACY_KEYRING_SERVICES:
+ return None
+ with _SCHEDULE_LOCK:
+ if _scheduled:
+ return None
+ _scheduled = True
+ thread = threading.Thread(
+ target=_run,
+ args=(delay_s,),
+ name="credential-migration",
+ daemon=True,
+ )
+ thread.start()
+ return thread
+
+
+__all__ = [
+ "DEFAULT_DELAY_S",
+ "StoreMigration",
+ "migrate_credentials",
+ "schedule_credential_migration",
+]
diff --git a/dodaios/core/identity_migration.py b/dodaios/core/identity_migration.py
index 4779bffdcb..9309fa7821 100644
--- a/dodaios/core/identity_migration.py
+++ b/dodaios/core/identity_migration.py
@@ -42,6 +42,11 @@ load this file by path before anything from the package exists. For the same
reason there is no ``from __future__ import annotations``: with string
annotations ``dataclasses`` looks the module up in ``sys.modules``, where a file
loaded by path need not be.
+
+The shell installers run this file as a program (:func:`main`), copied out of
+the release they are about to install, before any of it is checked out. The
+source therefore stays ASCII: a Windows PowerShell host reads text through a
+legacy code page and must not be able to alter a byte of it.
"""
import enum
@@ -126,6 +131,19 @@ def _is_link(metadata: os.stat_result) -> bool:
return getattr(metadata, "st_reparse_tag", 0) in _LINK_REPARSE_TAGS
+def is_directory_link(path: PathLike) -> bool:
+ """True when ``path`` itself is a symlink or a directory junction. Never follows it.
+
+ A caller about to delete a tree asks this first: removing a link must
+ remove the link, never what it leads to.
+ """
+ try:
+ return _is_link(os.lstat(path))
+ except OSError:
+ # Nothing there, or nothing that can be looked at: not a link.
+ return False
+
+
def _exists(path: PathLike) -> bool:
"""True unless the path is provably free. An unreadable path counts as taken."""
try:
@@ -798,6 +816,83 @@ def migrate_directory(
return report(step.outcome, rename_failure=step.rename_failure, detail=step.detail)
+# ----------------------------------------------------------------------
+# Is an installation in use?
+# ----------------------------------------------------------------------
+
+# OpenMutexW: SYNCHRONIZE access is enough to learn that the mutex exists.
+_SYNCHRONIZE = 0x00100000
+# ERROR_FILE_NOT_FOUND: no mutex of that name. Every other failure, access
+# denied included, means one exists or cannot be ruled out.
+_WINERROR_NO_SUCH_OBJECT = 2
+
+
+def named_mutex_exists(names: Iterable[str]) -> bool:
+ """True when a Windows named mutex of one of ``names`` exists. Always False elsewhere.
+
+ Opens, never creates: asking must not make this process look like the
+ instance that holds it. A probe that fails for any reason other than "no
+ such mutex" answers True, because the caller only moves directories when
+ nothing can be using them.
+ """
+ if sys.platform != "win32":
+ return False
+ try:
+ import ctypes # noqa: PLC0415 - Windows-only
+ from ctypes import wintypes # noqa: PLC0415 - Windows-only
+
+ kernel32 = ctypes.WinDLL("kernel32", use_last_error=True)
+ open_mutex = kernel32.OpenMutexW
+ open_mutex.argtypes = (wintypes.DWORD, wintypes.BOOL, wintypes.LPCWSTR)
+ open_mutex.restype = wintypes.HANDLE
+ close_handle = kernel32.CloseHandle
+ close_handle.argtypes = (wintypes.HANDLE,)
+ close_handle.restype = wintypes.BOOL
+ except (ImportError, OSError, AttributeError) as exc:
+ log.warning("Cannot ask Windows for a running instance (%s); assuming one runs.", exc)
+ return True
+ for name in names:
+ handle = open_mutex(_SYNCHRONIZE, False, name)
+ if handle:
+ close_handle(handle)
+ return True
+ error = ctypes.get_last_error()
+ if error != _WINERROR_NO_SUCH_OBJECT:
+ log.warning(
+ "Mutex %s cannot be probed (Windows error %s); assuming it is held.", name, error
+ )
+ return True
+ return False
+
+
+def lock_file_held(paths: Iterable[PathLike]) -> bool:
+ """True when another process holds the OS lock on one of the existing ``paths``.
+
+ A missing file is skipped and never created. The lock is taken for an
+ instant and dropped again; a file that cannot be opened or locked counts
+ as held.
+ """
+ for path in paths:
+ try:
+ fd = os.open(path, os.O_RDONLY | getattr(os, "O_BINARY", 0))
+ except (FileNotFoundError, NotADirectoryError):
+ # No lock file, so nothing can hold it.
+ continue
+ except OSError as exc:
+ log.warning("Lock file %s cannot be opened (%s); assuming it is held.", path, exc)
+ return True
+ try:
+ if not _try_lock(fd):
+ return True
+ _unlock(fd)
+ except OSError as exc:
+ log.warning("Lock file %s cannot be probed (%s); assuming it is held.", path, exc)
+ return True
+ finally:
+ os.close(fd)
+ return False
+
+
# ----------------------------------------------------------------------
# Keyring migration
# ----------------------------------------------------------------------
@@ -936,6 +1031,47 @@ def migrate_keyring(
)
+# ----------------------------------------------------------------------
+# Command line
+# ----------------------------------------------------------------------
+
+# How long the installer's run waits for another migrator of the same pair.
+_CLI_WAIT_SECONDS = 5.0
+_CLI_USAGE = "usage: identity_migration.py migrate|resolve <legacy> <current>\n"
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ """Move or resolve one directory pair and print what happened as one JSON object.
+
+ ``migrate <legacy> <current>`` runs :func:`migrate_directory`; ``resolve
+ <legacy> <current>`` only reads, through :func:`resolve_directory`. Either
+ prints ``{"outcome": ..., "effective": ...}`` on one line, where
+ ``effective`` is the directory to use from now on, and exits 0: every
+ outcome is a valid state to continue from. A malformed command line exits
+ 2 and prints nothing on stdout. The JSON is pure ASCII (non-ASCII path
+ characters are escaped), so no console encoding can change it on the way
+ to the caller. Diagnostics go to stderr.
+ """
+ args = list(sys.argv[1:] if argv is None else argv)
+ if len(args) != 3 or args[0] not in ("migrate", "resolve") or not all(args[1:]):
+ sys.stderr.write(_CLI_USAGE)
+ return 2
+ command, legacy, current = args
+ if not log.handlers and not logging.getLogger().handlers:
+ logging.basicConfig(level=logging.WARNING, format="%(message)s", stream=sys.stderr)
+ if command == "resolve":
+ outcome = "resolved"
+ effective = resolve_directory(current, [legacy])
+ else:
+ migration = migrate_directory(legacy, current, wait_seconds=_CLI_WAIT_SECONDS)
+ outcome = migration.outcome.value
+ effective = migration.effective
+ report = {"outcome": outcome, "effective": os.fspath(effective)}
+ sys.stdout.write(json.dumps(report, ensure_ascii=True) + "\n")
+ sys.stdout.flush()
+ return 0
+
+
__all__ = [
"DirectoryMigration",
"DirectoryOutcome",
@@ -948,8 +1084,16 @@ __all__ = [
"create_directory_link",
"default_lock_path",
"inspect_legacy",
+ "is_directory_link",
"keyring_marker_key",
+ "lock_file_held",
+ "main",
"migrate_directory",
"migrate_keyring",
+ "named_mutex_exists",
"resolve_directory",
]
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/dodaios/core/installer_update.py b/dodaios/core/installer_update.py
index 696fd3871c..8228647adc 100644
--- a/dodaios/core/installer_update.py
+++ b/dodaios/core/installer_update.py
@@ -5,12 +5,14 @@ has no git checkout, so ``dodaios/ui/web/update_routes.py``'s managed path canno
update it. What it does have is a GitHub Release carrying one installer asset
per platform plus a ``installers-SHA256SUMS.txt`` manifest:
-* ``PersonalJarvis-Setup-x64.exe`` Windows 10/11 x64
-* ``PersonalJarvis-macOS-arm64.dmg`` Apple Silicon
-* ``PersonalJarvis-macOS-x64.dmg`` Intel Mac
-* ``PersonalJarvis-Linux-x86_64.AppImage`` Linux x86_64
-
-A release may publish the same four files under the ``Dodaios-`` prefix instead;
+* ``Dodaios-Setup-x64.exe`` Windows 10/11 x64
+* ``Dodaios-macOS-arm64.dmg`` Apple Silicon
+* ``Dodaios-macOS-x64.dmg`` Intel Mac
+* ``Dodaios-Linux-x86_64.AppImage`` Linux x86_64
+
+Releases publish each file a second time, with identical bytes, under the
+earlier ``PersonalJarvis-`` prefix, which is the only one older installs know;
+releases from before the rename carry only that prefix.
:data:`INSTALLER_ASSET_NAMES` lists every accepted name per platform.
This module resolves which of those belongs to the running machine, downloads
@@ -50,7 +52,9 @@ from pathlib import Path
from typing import Any, Protocol
from dodaios.core.branding import (
+ LEGACY_MACOS_APP_DIR_NAMES,
MACOS_APP_DIR_NAME,
+ MACOS_APP_DIR_NAMES,
MACOS_BUNDLE_ID,
MACOS_DMG_BUNDLE_ID,
UPDATER_USER_AGENT,
@@ -150,11 +154,11 @@ class InstallerAsset:
#: Every installer file name the updater accepts, per ``(os, cpu)``, best
#: first. This is the one place the names live.
#:
-#: A release publishes each installer under ONE of the names in its row. The
-#: updater takes the first name the release actually carries, so an install
-#: keeps updating whichever prefix a release uses. The LAST name of a row is
-#: the one every release published so far carries
-#: (``scripts/ci/release_assets.py`` pins that set for the release pipeline).
+#: The updater takes the first name of its row that the release actually
+#: carries, so an install keeps updating whichever prefix a release uses.
+#: Current releases carry BOTH names of every row with identical bytes; the
+#: LAST name is the one every release ever published carries
+#: (``scripts/ci/release_assets.py`` pins the set for the release pipeline).
INSTALLER_ASSET_NAMES: dict[tuple[str, str], tuple[str, ...]] = {
("windows", "x64"): ("Dodaios-Setup-x64.exe", "PersonalJarvis-Setup-x64.exe"),
("macos", "arm64"): ("Dodaios-macOS-arm64.dmg", "PersonalJarvis-macOS-arm64.dmg"),
@@ -868,19 +872,21 @@ def _handover_macos(
"""Mount the DMG, swap the running ``.app`` for the one inside, relaunch.
The running bundle is replaced in place whenever the disk image carries
- the app under the running bundle's name or under the name this version
- ships with. The second case is a bundle the USER renamed or duplicated
- ("Keep Both" in Finder): the image still holds the usual name, and the
- update belongs into the bundle they launched.
-
- Only an image whose single bundle has a name this version has never used is
- a release that renamed the app. That one is installed beside the running
- bundle under its own name, relaunched from there, and the old bundle is
- removed afterwards (see :func:`_install_renamed_bundle`).
+ the app under the running bundle's name or under a name this version
+ knows (the current one or an earlier one). That covers a bundle the USER
+ renamed or duplicated ("Keep Both" in Finder): the image still holds the
+ usual name, and the update belongs into the bundle they launched.
+
+ Two cases install the image's bundle beside the running one under its own
+ name, relaunch it from there and set the old bundle aside afterwards (see
+ :func:`_install_renamed_bundle`): a running bundle that still carries an
+ earlier name of ours while the image carries the current one, and an image
+ whose single bundle has a name this version has never used (a release that
+ renamed the app again).
"""
if app_path is None:
raise InstallerUpdateError(
- "could not locate the running Personal Jarvis.app — refusing to update"
+ f"could not locate the running {MACOS_APP_DIR_NAME} — refusing to update"
)
mountpoint = Path(tempfile.mkdtemp(prefix="jarvis-dmg-"))
@@ -913,8 +919,15 @@ def _handover_macos(
)
source = candidates[0]
- known_names = {app_path.name.casefold(), MACOS_APP_DIR_NAME.casefold()}
- if source.name.casefold() in known_names:
+ known_names = {app_path.name.casefold(), *map(str.casefold, MACOS_APP_DIR_NAMES)}
+ earlier_names = set(map(str.casefold, LEGACY_MACOS_APP_DIR_NAMES))
+ # The bundle still has the name an earlier release gave it: the update
+ # brings the current name with it instead of filling the old folder.
+ takes_the_current_name = (
+ app_path.name.casefold() in earlier_names
+ and source.name.casefold() == MACOS_APP_DIR_NAME.casefold()
+ )
+ if source.name.casefold() in known_names and not takes_the_current_name:
installed = app_path
_replace_directory(source, app_path)
else:
@@ -1119,7 +1132,7 @@ def _install_renamed_bundle(source: Path, installed: Path, *, replaced: Path) ->
def _running_macos_app() -> Path | None:
- """``/Applications/Personal Jarvis.app`` for the RUNNING process, if any.
+ """The ``.app`` bundle of the RUNNING process (``/Applications/<name>.app``), if any.
``bundle_root()`` is ``<app>/Contents/MacOS``; the bundle is two levels up.
"""
diff --git a/dodaios/core/instance.py b/dodaios/core/instance.py
index b3f248696b..bee948b59f 100644
--- a/dodaios/core/instance.py
+++ b/dodaios/core/instance.py
@@ -42,6 +42,12 @@ from dataclasses import dataclass
from pathlib import Path
from dodaios.core.branding import (
+ LAUNCHER_ENTRY_NAME,
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_MUTEX_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
+ LINUX_APP_NAME,
LINUX_DESKTOP_ENTRY_FILE_NAME,
LINUX_WM_CLASS,
MACOS_BUNDLE_ID,
@@ -141,8 +147,10 @@ class InstanceIdentity:
def persistent_name(self) -> str:
"""The name this instance's OS artifacts are registered under.
- A compatibility contract (``dodaios.core.branding``): it names files such
- as the Start-Menu shortcut and never follows ``display_name``.
+ A compatibility contract (``dodaios.core.branding``) that never follows
+ ``display_name``. The Windows and Linux names moved on with their own
+ migrations (``windows_launcher_entry_name``, ``linux_app_name`` and the
+ file names beside them); this is the name those earlier releases used.
"""
if self.is_default:
return PERSISTENT_PRODUCT_NAME
@@ -150,14 +158,18 @@ class InstanceIdentity:
@property
def compact_name(self) -> str:
- """Persistent: names the branded launcher executable."""
+ """Persistent: the instance's name without spaces (``PersonalJarvisDev``)."""
if self.is_default:
return PERSISTENT_COMPACT_NAME
return f"{PERSISTENT_COMPACT_NAME}{self.label}"
@property
def slug(self) -> str:
- """Persistent: names the Linux desktop entry and window class."""
+ """Persistent: the hyphenated earlier name (``personal-jarvis-dev``).
+
+ Earlier releases named the Linux desktop entry and window class after
+ it; ``legacy_linux_desktop_entry_file_names`` still finds those entries.
+ """
return PERSISTENT_SLUG if self.is_default else f"{PERSISTENT_SLUG}-{self.name}"
# ---- storage / network ----------------------------------------------
@@ -191,29 +203,87 @@ class InstanceIdentity:
return WINDOWS_APP_USER_MODEL_ID
return f"{WINDOWS_APP_USER_MODEL_ID}.{self.label}"
+ @property
+ def windows_launcher_entry_name(self) -> str:
+ """The name Windows lists this instance under (shortcut, toast identity)."""
+ if self.is_default:
+ return LAUNCHER_ENTRY_NAME
+ return f"{LAUNCHER_ENTRY_NAME} {self.label}"
+
+ # Each Windows name below has a ``legacy_*`` twin: the names an earlier
+ # release registered the same instance under, derived the same way from the
+ # branding's ``LEGACY_*`` values. Code that only has to FIND an artifact
+ # (a running primary, a launcher to restart through, an old shortcut to
+ # retire) looks at both; code that CREATES one uses the current name.
@property
def windows_mutex_name(self) -> str:
- return WINDOWS_MUTEX_NAME if self.is_default else f"{WINDOWS_MUTEX_NAME}_{self.name}"
+ return self._mutex_name(WINDOWS_MUTEX_NAME)
+
+ @property
+ def legacy_windows_mutex_names(self) -> tuple[str, ...]:
+ return tuple(self._mutex_name(base) for base in LEGACY_WINDOWS_MUTEX_NAMES)
@property
def windows_shortcut_file_name(self) -> str:
- return WINDOWS_SHORTCUT_FILE_NAME if self.is_default else f"{self.persistent_name}.lnk"
+ return self._shortcut_file_name(WINDOWS_SHORTCUT_FILE_NAME)
+
+ @property
+ def legacy_windows_shortcut_file_names(self) -> tuple[str, ...]:
+ return tuple(self._shortcut_file_name(base) for base in LEGACY_WINDOWS_SHORTCUT_FILE_NAMES)
@property
def windows_branded_launcher_file_name(self) -> str:
- return (
- WINDOWS_BRANDED_LAUNCHER_FILE_NAME
- if self.is_default
- else f"{self.compact_name}.exe"
+ return self._launcher_file_name(WINDOWS_BRANDED_LAUNCHER_FILE_NAME)
+
+ @property
+ def legacy_windows_branded_launcher_file_names(self) -> tuple[str, ...]:
+ return tuple(
+ self._launcher_file_name(base) for base in LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES
)
+ def _mutex_name(self, base: str) -> str:
+ return base if self.is_default else f"{base}_{self.name}"
+
+ def _shortcut_file_name(self, base: str) -> str:
+ if self.is_default:
+ return base
+ stem = base.removesuffix(".lnk")
+ return f"{stem} {self.label}.lnk"
+
+ def _launcher_file_name(self, base: str) -> str:
+ if self.is_default:
+ return base
+ stem = base.removesuffix(".exe")
+ return f"{stem}{self.label}.exe"
+
+ # The Linux names move together: the desktop binds a running window to the
+ # entry whose ``StartupWMClass`` is the window's class, so an entry file,
+ # its ``Name`` and the class pinned at runtime always come from one
+ # generation of the branding values.
+ @property
+ def linux_app_name(self) -> str:
+ """The name the Linux app menu lists this instance under."""
+ return LINUX_APP_NAME if self.is_default else f"{LINUX_APP_NAME} {self.label}"
+
@property
def linux_wm_class(self) -> str:
- return LINUX_WM_CLASS if self.is_default else self.slug
+ return LINUX_WM_CLASS if self.is_default else f"{LINUX_WM_CLASS}-{self.name}"
@property
def linux_desktop_entry_file_name(self) -> str:
- return LINUX_DESKTOP_ENTRY_FILE_NAME if self.is_default else f"{self.slug}.desktop"
+ return self._linux_entry_file_name(LINUX_DESKTOP_ENTRY_FILE_NAME)
+
+ @property
+ def legacy_linux_desktop_entry_file_names(self) -> tuple[str, ...]:
+ return tuple(
+ self._linux_entry_file_name(base) for base in LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES
+ )
+
+ def _linux_entry_file_name(self, base: str) -> str:
+ if self.is_default:
+ return base
+ stem = base.removesuffix(".desktop")
+ return f"{stem}-{self.name}.desktop"
@property
def macos_bundle_id(self) -> str:
diff --git a/dodaios/core/keychain_bundle.py b/dodaios/core/keychain_bundle.py
index ef791be9f9..c861a2166d 100644
--- a/dodaios/core/keychain_bundle.py
+++ b/dodaios/core/keychain_bundle.py
@@ -47,12 +47,14 @@ from __future__ import annotations
import base64
import binascii
+import enum
import json
import logging
import re
import subprocess
import sys
import threading
+from dataclasses import dataclass
from typing import Any
logger = logging.getLogger(__name__)
@@ -68,7 +70,8 @@ _SECURITY_BIN = "/usr/bin/security"
# probed empirically; the only non-zero exit treated as a clean "no value".
_SECURITY_NOT_FOUND_EXIT = 44
# Tokens interpolated into a ``security -i`` command line. Service and account
-# names are fixed internal constants ("personal-jarvis", "__jarvis_vault__");
+# names are fixed internal constants ("dodaios" and the legacy
+# "personal-jarvis", "__jarvis_vault__");
# anything outside this conservative charset falls back to the inner backend
# rather than risking the CLI's whitespace/quote parsing.
_SAFE_CLI_TOKEN = re.compile(r"^[A-Za-z0-9._-]+$")
@@ -274,11 +277,12 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
# inner backend. In practice dodaios/core/config.py always passes the
# same ``KEYRING_SERVICE`` constant, so this holds exactly one entry.
self._cache: dict[str, dict[str, str]] = {}
- # Set once an existing vault item fails to parse as a JSON object.
- # From then on every call for the rest of the process delegates
- # straight to the inner backend so the malformed item is read
- # (logged once), never silently overwritten or destroyed.
- self._bundle_unusable = False
+ # Services whose existing vault item failed to parse as a JSON object.
+ # From then on every call for that service, for the rest of the
+ # process, delegates straight to the inner backend so the malformed
+ # item is read (logged once), never silently overwritten or destroyed.
+ # Per service: a broken legacy vault must not hide the current one.
+ self._unusable_services: set[str] = set()
# -- internal helpers ---------------------------------------------------
@@ -309,9 +313,9 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
def _load_locked(self, service: str, *, refresh: bool = False) -> dict[str, str]:
"""Return the parsed vault dict for *service*, loading it once.
- Caller must hold ``self._lock``. On a JSON-decode error, sets
- ``self._bundle_unusable`` and returns an empty dict without touching
- the stored item.
+ Caller must hold ``self._lock``. On a JSON-decode error, marks
+ *service* unusable and returns an empty dict without touching the
+ stored item.
``refresh=True`` bypasses the cache and re-reads the stored item:
every mutation path uses it so a concurrent WRITE from another
@@ -325,21 +329,7 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
cached = self._cache.get(service)
if cached is not None and not refresh:
return cached
- raw: str | None = None
- used_cli = False
- if self._cli is not None:
- try:
- raw = self._cli.read(service, VAULT_ACCOUNT)
- used_cli = True
- except Exception: # noqa: BLE001 -- CLI oddity must not hide the vault
- logger.warning(
- "security CLI vault read failed; falling back to the "
- "in-process keyring read (which may show one Keychain "
- "dialog).",
- exc_info=True,
- )
- if not used_cli:
- raw = self._inner.get_password(service, VAULT_ACCOUNT)
+ raw, used_cli = self._read_raw_locked(service)
if raw is None:
bundle: dict[str, str] = {}
self._cache[service] = bundle
@@ -352,7 +342,7 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
"malformed item is left untouched.",
VAULT_ACCOUNT,
)
- self._bundle_unusable = True
+ self._unusable_services.add(service)
return {}
bundle = {str(k): str(v) for k, v in parsed.items()}
self._cache[service] = bundle
@@ -372,6 +362,23 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
)
return bundle
+ def _read_raw_locked(self, service: str) -> tuple[str | None, bool]:
+ """The stored vault payload of *service* and whether the CLI served it.
+
+ Caller holds the lock. Reads only: no format upgrade, no cache update.
+ """
+ if self._cli is not None:
+ try:
+ return self._cli.read(service, VAULT_ACCOUNT), True
+ except Exception: # noqa: BLE001 -- CLI oddity must not hide the vault
+ logger.warning(
+ "security CLI vault read failed; falling back to the "
+ "in-process keyring read (which may show one Keychain "
+ "dialog).",
+ exc_info=True,
+ )
+ return self._inner.get_password(service, VAULT_ACCOUNT), False
+
def _save_locked(self, service: str, bundle: dict[str, str]) -> None:
"""Persist *bundle* as the single vault item. Caller holds the lock."""
payload = json.dumps(bundle)
@@ -410,12 +417,12 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
if key == VAULT_ACCOUNT:
# The vault item itself is never bundled into itself.
return self._inner.get_password(service, key)
- if self._bundle_unusable:
+ if service in self._unusable_services:
return self._inner.get_password(service, key)
with self._lock:
bundle = self._load_locked(service)
- if self._bundle_unusable:
+ if service in self._unusable_services:
# Discovered just now while loading; do not treat this read
# as a bundle miss, delegate straight through instead.
return self._inner.get_password(service, key)
@@ -443,7 +450,7 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
def _migrate_legacy(self, service: str, key: str, value: str) -> None:
with self._lock:
bundle = self._load_locked(service, refresh=True)
- if self._bundle_unusable:
+ if service in self._unusable_services:
# Nothing to migrate into; leave the legacy item alone.
return
bundle[key] = value
@@ -460,12 +467,12 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
if key == VAULT_ACCOUNT:
self._inner.set_password(service, key, value)
return
- if self._bundle_unusable:
+ if service in self._unusable_services:
self._inner.set_password(service, key, value)
return
with self._lock:
bundle = self._load_locked(service, refresh=True)
- if self._bundle_unusable:
+ if service in self._unusable_services:
self._inner.set_password(service, key, value)
return
bundle[key] = value
@@ -475,14 +482,14 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
if key == VAULT_ACCOUNT:
self._inner.delete_password(service, key)
return
- if self._bundle_unusable:
+ if service in self._unusable_services:
self._inner.delete_password(service, key)
return
removed_from_bundle = False
with self._lock:
bundle = self._load_locked(service, refresh=True)
- if self._bundle_unusable:
+ if service in self._unusable_services:
self._inner.delete_password(service, key)
return
if key in bundle:
@@ -502,3 +509,116 @@ class DarwinBundleKeyringBackend(_KeyringBackendBase): # type: ignore[valid-typ
if not removed_from_bundle and not removed_legacy:
self._raise_missing_password_error(service, key)
+
+ # -- read-only access and the service rename ------------------------------
+
+ def _peek_bundle_locked(self, service: str) -> dict[str, str] | None:
+ """The vault of *service* without any side effect; ``None`` if malformed.
+
+ Caller holds the lock. A parsed vault is cached like a normal load (a
+ later mutation re-reads it anyway); a malformed one is neither cached
+ nor recorded, so it changes nothing for the rest of the process.
+ """
+ cached = self._cache.get(service)
+ if cached is not None:
+ return cached
+ raw, _used_cli = self._read_raw_locked(service)
+ if raw is None:
+ bundle: dict[str, str] = {}
+ else:
+ parsed, _was_base64 = self._decode_vault_payload(raw)
+ if parsed is None:
+ return None
+ bundle = {str(k): str(v) for k, v in parsed.items()}
+ self._cache[service] = bundle
+ return bundle
+
+ def peek_password(self, service: str, key: str) -> str | None:
+ """Read one value without writing anything, in this service or another.
+
+ ``get_password`` folds a per-item entry it finds into the vault and may
+ rewrite a vault into the any-application format. Neither may happen on
+ a read of a legacy service (``dodaios.core.config.get_secret``): its
+ entries are the way back for a downgrade and stay exactly as they are.
+ """
+ if key == VAULT_ACCOUNT or service in self._unusable_services:
+ return self._inner.get_password(service, key)
+ with self._lock:
+ bundle = self._peek_bundle_locked(service)
+ if bundle is not None and key in bundle:
+ return bundle[key]
+ return self._inner.get_password(service, key)
+
+ def stored_keys(self, service: str) -> tuple[str, ...]:
+ """Every key the vault of *service* holds (read-only, never prompts per key)."""
+ if service in self._unusable_services:
+ return ()
+ with self._lock:
+ bundle = self._peek_bundle_locked(service)
+ return tuple(bundle) if bundle else ()
+
+ def copy_vault(self, legacy_service: str, current_service: str, *, marker: str) -> VaultCopy:
+ """Copy the legacy vault into the current service in ONE vault write.
+
+ The vault holds every key, so this replaces a per-key migration that
+ would rewrite the current vault once per key. When the current service
+ has no vault yet, the legacy payload is taken over whole; when it has
+ one (a key saved under the new name already), only the keys it lacks
+ are added: a current value is never overwritten. ``marker`` is written
+ into the same payload, so the copy and the "done" record land together.
+ The legacy vault is only read, never changed. The written payload is
+ read back before the copy counts.
+ """
+ with self._lock:
+ legacy_raw, _ = self._read_raw_locked(legacy_service)
+ if legacy_raw is None:
+ return VaultCopy(VaultCopyOutcome.NO_LEGACY_VAULT)
+ legacy, _ = self._decode_vault_payload(legacy_raw)
+ if legacy is None:
+ logger.warning(
+ "Legacy Keychain vault of %r is malformed; it is left untouched "
+ "and its keys are read one by one instead.",
+ legacy_service,
+ )
+ return VaultCopy(VaultCopyOutcome.MALFORMED)
+ current_raw, _ = self._read_raw_locked(current_service)
+ current: dict[str, Any] = {}
+ if current_raw is not None:
+ parsed, _ = self._decode_vault_payload(current_raw)
+ if parsed is None:
+ return VaultCopy(VaultCopyOutcome.MALFORMED)
+ current = parsed
+ if current.get(marker):
+ return VaultCopy(VaultCopyOutcome.ALREADY_COPIED)
+ merged = {str(k): str(v) for k, v in legacy.items()}
+ copied = tuple(key for key in merged if key not in current)
+ merged.update({str(k): str(v) for k, v in current.items()})
+ merged[marker] = "1"
+ self._save_locked(current_service, merged)
+ stored_raw, _ = self._read_raw_locked(current_service)
+ stored, _ = self._decode_vault_payload(stored_raw) if stored_raw else (None, False)
+ if stored != merged:
+ self._cache.pop(current_service, None)
+ logger.warning("Copied Keychain vault did not read back; it is retried later.")
+ return VaultCopy(VaultCopyOutcome.FAILED)
+ self._cache[current_service] = merged
+ return VaultCopy(VaultCopyOutcome.COPIED, copied=copied)
+
+
+class VaultCopyOutcome(enum.Enum):
+ """What :meth:`DarwinBundleKeyringBackend.copy_vault` did."""
+
+ COPIED = "copied"
+ ALREADY_COPIED = "already_copied"
+ # Nothing was ever saved under the legacy name in vault form.
+ NO_LEGACY_VAULT = "no_legacy_vault"
+ MALFORMED = "malformed"
+ FAILED = "failed"
+
+
+@dataclass(frozen=True, slots=True)
+class VaultCopy:
+ """The outcome of one vault copy. Key names only, never a value."""
+
+ outcome: VaultCopyOutcome
+ copied: tuple[str, ...] = ()
diff --git a/dodaios/core/paths.py b/dodaios/core/paths.py
index 8490d9008c..98c117cada 100644
--- a/dodaios/core/paths.py
+++ b/dodaios/core/paths.py
@@ -1,9 +1,12 @@
"""Central app directory convention.
Dodaios writes user data (skills, memory, logs, session file) to a
-single canonical location — analogous to Claude Code's ``~/.claude/``. On Windows
-this is ``%LOCALAPPDATA%\\Jarvis``; when the ENV variable is absent (portable
-scripts, tests) we fall back to ``~/.jarvis/``.
+single canonical location. On Windows this is ``%LOCALAPPDATA%\\Dodaios``; when
+the ENV variable is absent (portable scripts, tests) it is ``~/.dodaios-data``.
+An installation from before the rename keeps its directory under the earlier
+name (``Jarvis`` / ``.jarvis``) for as long as that is a real directory; the
+primary instance moves it at boot and leaves a link behind
+(``dodaios.core.identity_boot``).
This module replaces the scattered ``Path.home() / ".jarvis"`` literals and the
local ``_app_data_dir()`` in ``dodaios.ui.shell.single_instance``. All consumers
@@ -12,32 +15,33 @@ go through the getters defined here.
from __future__ import annotations
-import os
import sys
import sysconfig
from pathlib import Path
from dodaios.core.branding import (
DESKTOP_OUTPUT_MIRROR_DIR_NAME,
- DISTRIBUTION_NAME,
- FALLBACK_USER_DATA_DIR_NAME,
- WINDOWS_USER_DATA_DIR_NAME,
+ DISTRIBUTION_NAMES,
+ LEGACY_DESKTOP_OUTPUT_MIRROR_DIR_NAMES,
)
+from dodaios.core.identity_boot import resolve_named_dir, resolve_pair, user_data_dir_pair
def user_data_dir() -> Path:
"""App data directory in the user context.
- - Windows: ``%LOCALAPPDATA%\\Jarvis`` (standard convention for local app data).
- - Fallback: ``~/.jarvis`` — relevant when ``LOCALAPPDATA`` is not set
+ - Windows: ``%LOCALAPPDATA%\\Dodaios`` (standard convention for local app data).
+ - Fallback: ``~/.dodaios-data`` — relevant when ``LOCALAPPDATA`` is not set
(e.g. in some CI environments, Unix dev setups, test runs).
+ A real directory under the earlier name (``Jarvis`` / ``.jarvis``) wins
+ while it exists: that is an installation whose data has not been moved
+ yet. Resolved with a few ``stat`` calls and cached per process
+ (``dodaios.core.identity_boot.resolve_pair``).
+
Does NOT create the directory — use ``ensure_user_dirs()`` for that.
"""
- base = os.environ.get("LOCALAPPDATA")
- if base:
- return Path(base) / WINDOWS_USER_DATA_DIR_NAME
- return Path.home() / FALLBACK_USER_DATA_DIR_NAME
+ return resolve_pair(user_data_dir_pair())
def user_skills_dir() -> Path:
@@ -158,14 +162,17 @@ def default_doc_roots() -> list[Path]:
except (KeyError, TypeError, ValueError):
pass
+ # A wheel under the earlier distribution name installs under that
+ # ``share/<name>``; the current name wins where both exist.
seen_prefixes: set[Path] = set()
for prefix in data_prefixes:
if prefix in seen_prefixes:
continue
seen_prefixes.add(prefix)
- installed_docs = prefix / "share" / DISTRIBUTION_NAME / "docs"
- if installed_docs.exists():
- return [installed_docs]
+ for distribution in DISTRIBUTION_NAMES:
+ installed_docs = prefix / "share" / distribution / "docs"
+ if installed_docs.exists():
+ return [installed_docs]
# Fail closed if the packaged reader library is missing. Falling back to
# the engineering archive could expose plans, audits, or local diagnostics.
@@ -190,8 +197,16 @@ def user_outputs_dir() -> Path:
def desktop_mirror_dir() -> Path:
- """Desktop junction root for direct access to sub-agent outputs."""
- return Path.home() / "Desktop" / DESKTOP_OUTPUT_MIRROR_DIR_NAME
+ """Desktop junction root for direct access to sub-agent outputs.
+
+ ``~/Desktop/Dodaios-Output``, or the folder under its earlier name while
+ that one exists: a folder on the Desktop is never renamed under the user.
+ """
+ return resolve_named_dir(
+ Path.home() / "Desktop",
+ DESKTOP_OUTPUT_MIRROR_DIR_NAME,
+ LEGACY_DESKTOP_OUTPUT_MIRROR_DIR_NAMES,
+ )
def ensure_session_output_dir(slug: str) -> tuple[Path, Path]:
@@ -202,7 +217,7 @@ def ensure_session_output_dir(slug: str) -> tuple[Path, Path]:
``canonical`` for one-click Desktop access. On macOS/Linux (including a
headless server with no Desktop) the junction is skipped and ``mirror``
equals ``canonical``, so callers always receive a usable path and no
- stray ``~/Desktop/Jarvis-Output`` folder is created.
+ stray ``~/Desktop/Dodaios-Output`` folder is created.
"""
import subprocess
@@ -213,7 +228,7 @@ def ensure_session_output_dir(slug: str) -> tuple[Path, Path]:
# The Desktop mirror is a Windows directory junction (``mklink /J``) — a
# convenience, never a core path. Skip it entirely off Windows so a headless
- # VPS or a Mac never grows an empty ``~/Desktop/Jarvis-Output`` directory.
+ # VPS or a Mac never grows an empty ``~/Desktop/Dodaios-Output`` directory.
if sys.platform != "win32":
return canonical, canonical
diff --git a/dodaios/core/secret_slots.py b/dodaios/core/secret_slots.py
new file mode 100644
index 0000000000..d3c5c19932
--- /dev/null
+++ b/dodaios/core/secret_slots.py
@@ -0,0 +1,248 @@
+"""Every name a credential is stored under, as far as it can be known.
+
+``set_secret(key, value)`` files a credential under ``key`` in the OS
+credential store. A credential store cannot be listed portably, so anything
+that has to visit every stored credential (the one-time copy to a renamed
+service, the uninstaller) needs the names from here:
+
+* ``KNOWN_SECRET_KEYS`` -- the fixed names, spelled as literals or module
+ constants at the place that saves them.
+* ``DYNAMIC_SLOT_SOURCES`` -- every module that computes a name at runtime
+ (from a table, a catalog, or a record the user created), with what the
+ names look like and, where it is cheap and side-effect free, how to list
+ the ones that exist right now.
+
+``tests/unit/core/test_secret_slots_coverage.py`` reads every ``set_secret``
+and ``set_password`` call in the package: a fixed name must be listed here, and
+a computed one must come from a module in ``DYNAMIC_SLOT_SOURCES``. A name
+that cannot be listed is still safe: ``dodaios.core.config.get_secret`` reads
+the legacy service whenever the current one has nothing for a slot, so the
+listing is an optimisation for the copy and a completeness aid for the
+uninstaller, never the thing that keeps a credential reachable.
+
+Importing this module imports nothing else from the package; each lister
+imports its source lazily and only when called.
+"""
+
+from __future__ import annotations
+
+import logging
+from collections.abc import Callable, Iterable, Mapping
+from dataclasses import dataclass
+from types import MappingProxyType
+
+log = logging.getLogger(__name__)
+
+# The fixed names: each is saved (or read) under exactly this spelling.
+KNOWN_SECRET_KEYS: frozenset[str] = frozenset(
+ {
+ # dodaios.core.control_key.KEYRING_SLOT
+ "jarvis_control_api_key",
+ # dodaios.admin.client.ADMIN_HMAC_KEY
+ "jarvis_admin_hmac",
+ # dodaios.channels.telegram, dodaios.marketplace.telegram_connect
+ "telegram_bot_token",
+ # dodaios.marketplace.discord_connect
+ "discord_bot_token",
+ # dodaios.friends.identity.PRIVKEY_SECRET_KEY
+ "socials_node_privkey",
+ # dodaios.computers.identity.PRIVATE_KEY_SECRET
+ "computers_ssh_private_key",
+ # dodaios.ui.web.telephony_routes
+ "twilio_auth_token",
+ # dodaios.core.config (team proxy credential)
+ "team_proxy_token",
+ # Read by name in provider adapters; saved through the wizard table.
+ "cartesia_api_key",
+ "codex_openai_api_key",
+ "huggingface",
+ "inworld_api_key",
+ "openai_api_key",
+ "zai_api_key",
+ }
+)
+
+
+@dataclass(frozen=True)
+class SlotSource:
+ """A module that computes credential names at runtime."""
+
+ # What the names look like, for a reader of this table.
+ shape: str
+ # Lists the names that exist right now, or ``None`` when that needs work
+ # this module should not do (a database query, a network call).
+ lister: Callable[[], Iterable[str]] | None = None
+
+
+def _wizard_keys() -> Iterable[str]:
+ from dodaios.setup.wizard import SECRETS
+
+ return (spec.key for spec in SECRETS)
+
+
+def _provider_candidate_keys() -> Iterable[str]:
+ from dodaios.core.config import PROVIDER_SECRET_CANDIDATES
+
+ return (key for pairs in PROVIDER_SECRET_CANDIDATES.values() for key, _env in pairs)
+
+
+def _cloud_provider_keys() -> Iterable[str]:
+ from dodaios.computers.cloud import PROVIDERS
+
+ return (spec.keyring_slot for spec in PROVIDERS.values())
+
+
+def _computer_keys() -> Iterable[str]:
+ from dodaios.computers.service import (
+ _passphrase_slot,
+ _password_slot,
+ _private_key_slot,
+ )
+ from dodaios.computers.store import ComputerStore
+
+ for computer in ComputerStore().all():
+ yield _password_slot(computer.id)
+ yield _private_key_slot(computer.id)
+ yield _passphrase_slot(computer.id)
+
+
+def _paired_server_keys() -> Iterable[str]:
+ from dodaios.computers.pairing import _slot, get_pairing
+
+ return (_slot(server.id) for server in get_pairing().servers())
+
+
+def _cli_keys() -> Iterable[str]:
+ from dodaios.clis.catalog import load_catalog
+
+ return (key for spec in load_catalog().values() for key in spec.auth.secret_keys)
+
+
+def _mcp_keys() -> Iterable[str]:
+ from dodaios.mcp.registry import MCPRegistry
+
+ registry = MCPRegistry()
+ registry.load_from_mcp_json()
+ return (key for spec in registry.all_specs() for key in spec.required_auth)
+
+
+def _oauth_families() -> set[str]:
+ from dodaios.marketplace.catalog_data import load_catalog
+ from dodaios.marketplace.publisher_clients import (
+ SHIPPED_PUBLIC_CLIENT_IDS,
+ SHIPPED_TOKEN_BROKERS,
+ )
+
+ families = set(SHIPPED_PUBLIC_CLIENT_IDS) | set(SHIPPED_TOKEN_BROKERS)
+ families.update(
+ plugin.oauth_client_family
+ for plugin in load_catalog().plugins
+ if plugin.oauth_client_family
+ )
+ return families
+
+
+def _oauth_client_keys() -> Iterable[str]:
+ from dodaios.marketplace.publisher_clients import (
+ publisher_secret_names,
+ publisher_secret_names_secret,
+ )
+
+ for family in sorted(_oauth_families()):
+ yield f"{family}_oauth_client_id"
+ yield f"{family}_oauth_client_secret"
+ yield publisher_secret_names(family)[0]
+ yield publisher_secret_names_secret(family)[0]
+
+
+def _plugin_token_keys() -> Iterable[str]:
+ from dodaios.marketplace.catalog_data import load_catalog
+ from dodaios.marketplace.token_store import _keyring_key
+
+ # The head entry of each plugin's token blob. A long blob continues in
+ # chunk entries named after the head; those are read through the legacy
+ # fallback until the plugin saves its tokens again.
+ for plugin in load_catalog().plugins:
+ try:
+ yield _keyring_key(plugin.id)
+ except ValueError:
+ # The token store refuses this id, so nothing can be stored under it.
+ log.debug("catalog plugin id %r has no token slot", plugin.id)
+
+
+_SOURCES: dict[str, SlotSource] = {
+ "dodaios.core.config": SlotSource(
+ "provider slots of PROVIDER_SECRET_CANDIDATES", _provider_candidate_keys
+ ),
+ "dodaios.setup.wizard": SlotSource("the keys of the SECRETS table", _wizard_keys),
+ "dodaios.ui.web.control_routes": SlotSource(
+ "a key of the wizard SECRETS table (ALLOWED_SECRET_KEYS)", _wizard_keys
+ ),
+ "dodaios.ui.web.provider_routes": SlotSource(
+ "a key of the wizard SECRETS table, or its provider family's slot", _wizard_keys
+ ),
+ "dodaios.computers.cloud": SlotSource(
+ "<provider>_api_token from the PROVIDERS table", _cloud_provider_keys
+ ),
+ "dodaios.computers.service": SlotSource(
+ "computer_password_<id>, computer_private_key_<id>, computer_key_passphrase_<id>",
+ _computer_keys,
+ ),
+ "dodaios.computers.pairing": SlotSource("paired_server_<id>", _paired_server_keys),
+ "dodaios.clis.auth": SlotSource(
+ "auth.secret_keys of a CLI catalog entry", _cli_keys
+ ),
+ "dodaios.ui.web.mcp_routes": SlotSource(
+ "required_auth of an MCP server spec", _mcp_keys
+ ),
+ "dodaios.marketplace.publisher_clients": SlotSource(
+ "<family>_oauth_client_id/_secret, publisher_<family>_oauth_client_id/_secret",
+ _oauth_client_keys,
+ ),
+ "dodaios.marketplace.token_store": SlotSource(
+ "plugin_<id>_tokens, plus chunk entries <head>__<n> / <head>__b<bank>_<n>",
+ _plugin_token_keys,
+ ),
+ "dodaios.society.credentials": SlotSource("society_credential.<agent>.<ENV_NAME>"),
+ "dodaios.tasks.source_credentials": SlotSource(
+ "routine_source_<id>_<created_at_ns>_<field>"
+ ),
+ "dodaios.tasks.webhook_auth": SlotSource("routine_webhook_<id>_<created_at_ns>"),
+ "dodaios.ui.web.routine_hooks_routes": SlotSource(
+ "routine_webhook_<id>_<created_at_ns> (dodaios.tasks.webhook_auth)"
+ ),
+}
+
+#: Module name -> how it names credentials at runtime.
+DYNAMIC_SLOT_SOURCES: Mapping[str, SlotSource] = MappingProxyType(_SOURCES)
+
+
+def dynamic_secret_keys() -> frozenset[str]:
+ """The computed names that exist right now, from every source that can list them.
+
+ A source that fails (a store that does not exist yet, a catalog that does
+ not parse) is logged and skipped: the others still count.
+ """
+ found: set[str] = set()
+ for module, source in DYNAMIC_SLOT_SOURCES.items():
+ if source.lister is None:
+ continue
+ try:
+ found.update(key for key in source.lister() if key)
+ except Exception as exc: # noqa: BLE001 — one unlistable source must not hide the rest
+ log.info("credential names of %s not listed (%s)", module, type(exc).__name__)
+ return frozenset(found)
+
+
+def all_secret_keys() -> frozenset[str]:
+ """Every credential name that can be known without the store listing itself."""
+ return KNOWN_SECRET_KEYS | dynamic_secret_keys()
+
+
+__all__ = [
+ "DYNAMIC_SLOT_SOURCES",
+ "KNOWN_SECRET_KEYS",
+ "SlotSource",
+ "all_secret_keys",
+ "dynamic_secret_keys",
+]
diff --git a/dodaios/core/self_mod/writer.py b/dodaios/core/self_mod/writer.py
index 765e38d7ba..adee9b6797 100644
--- a/dodaios/core/self_mod/writer.py
+++ b/dodaios/core/self_mod/writer.py
@@ -45,7 +45,7 @@ from pydantic import ValidationError as PydanticValidationError
from tomlkit import TOMLDocument
from tomlkit.items import AbstractTable
-from dodaios.core.branding import CONFIG_FILE_NAME
+from dodaios.core.branding import CONFIG_FILE_NAME, LEGACY_CONFIG_FILE_NAMES
from dodaios.core.bus import EventBus
from dodaios.core.config import (
JarvisConfig,
@@ -82,10 +82,29 @@ _LOG = logging.getLogger(__name__)
DEFAULT_BACKUP_SUBDIR = "backups/self_mod"
_LEGACY_BACKUP_SUBDIR = ".backups"
BACKUP_FILE_GLOB = f"{CONFIG_FILE_NAME}.*.bak"
+# A backup is named after the file it copies, and a configuration may still
+# carry its earlier name; backups of either are listed and pruned together.
+BACKUP_FILE_GLOBS = tuple(
+ f"{name}.*.bak" for name in (CONFIG_FILE_NAME, *LEGACY_CONFIG_FILE_NAMES)
+)
BACKUP_TS_FORMAT = "%Y%m%dT%H%M%S_%fZ"
_ATOMIC_REPLACE_RETRY_DELAYS_S = (0.0, 0.025, 0.05, 0.1, 0.2, 0.4)
+def _backup_files(root: Path) -> list[Path]:
+ """Every config backup in ``root``, whatever name the copied file had."""
+ found: dict[Path, None] = {}
+ for pattern in BACKUP_FILE_GLOBS:
+ found.update(dict.fromkeys(root.glob(pattern)))
+ return list(found)
+
+
+def _backup_prefix_name(config_path: Path) -> str:
+ """The name a backup of ``config_path`` starts with: the file's own known name."""
+ known = (CONFIG_FILE_NAME, *LEGACY_CONFIG_FILE_NAMES)
+ return config_path.name if config_path.name in known else CONFIG_FILE_NAME
+
+
def _default_backup_dir() -> Path:
"""Return a portable backup path outside the config watchdog scope."""
configured = os.environ.get("JARVIS_DATA_DIR", "").strip()
@@ -254,7 +273,7 @@ class AtomicConfigWriter:
for root in (self._backup_dir, *self._legacy_backup_dirs):
if not root.exists():
continue
- for path in root.glob(BACKUP_FILE_GLOB):
+ for path in _backup_files(root):
try:
stat = path.stat()
except FileNotFoundError:
@@ -607,7 +626,7 @@ class AtomicConfigWriter:
# mkstemp writes the final .bak file directly; uniqueness is OS-guaranteed.
fd, target_name = tempfile.mkstemp(
suffix=".bak",
- prefix=f"{CONFIG_FILE_NAME}.{ts}.",
+ prefix=f"{_backup_prefix_name(self._config_path)}.{ts}.",
dir=str(self._backup_dir),
)
target = Path(target_name)
@@ -669,7 +688,7 @@ class AtomicConfigWriter:
if not self._backup_dir.exists():
return
backups = sorted(
- self._backup_dir.glob(BACKUP_FILE_GLOB),
+ _backup_files(self._backup_dir),
key=lambda p: p.stat().st_mtime,
) # oldest first
if len(backups) <= self._backup_min_keep:
@@ -766,4 +785,4 @@ def _summarize_error(exc: BaseException) -> str:
return first[:200] if len(first) > 200 else first
-__all__ = ["BACKUP_FILE_GLOB", "DEFAULT_BACKUP_SUBDIR", "AtomicConfigWriter"]
+__all__ = ["BACKUP_FILE_GLOB", "BACKUP_FILE_GLOBS", "DEFAULT_BACKUP_SUBDIR", "AtomicConfigWriter"]
diff --git a/dodaios/core/update_contract.py b/dodaios/core/update_contract.py
index 548a6fe768..eff25d990a 100644
--- a/dodaios/core/update_contract.py
+++ b/dodaios/core/update_contract.py
@@ -27,7 +27,12 @@ import re
from dataclasses import dataclass, replace
from pathlib import Path
-from dodaios.core.branding import CONFIG_FILE_NAME, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID
+from dodaios.core.branding import (
+ CONFIG_FILE_NAME,
+ LEGACY_CONFIG_FILE_NAMES,
+ MACOS_APP_DIR_NAME,
+ MACOS_BUNDLE_ID,
+)
log = logging.getLogger(__name__)
@@ -72,8 +77,16 @@ class UpdateContract:
launcher_module: str = "dodaios.ui.web.launcher"
#: File whose ``__version__ = "..."`` line names the release.
version_file: str = "dodaios/__init__.py"
- #: Name of the user's config file in the checkout root.
- config_file: str = CONFIG_FILE_NAME
+ #: Name of the user's config file in the checkout root, as an updater from
+ #: before ``config_files`` reads it. That updater only reads the admin port
+ #: from it, so the earlier name it can still find is the one stated.
+ config_file: str = LEGACY_CONFIG_FILE_NAMES[0]
+ #: Every name the config file may have in the checkout root, in order of
+ #: precedence: the first that exists is the configuration. A file is never
+ #: renamed, so an installation keeps its ``jarvis.toml`` and a new one has
+ #: ``dodaios.toml``. A document that states only ``config_file`` means that
+ #: one name.
+ config_files: tuple[str, ...] = (*LEGACY_CONFIG_FILE_NAMES, CONFIG_FILE_NAME)
#: Directory name of the macOS application bundle the installer builds.
macos_app_dir_name: str = MACOS_APP_DIR_NAME
#: ``CFBundleIdentifier`` of that bundle. A bundle of the right name with
@@ -134,6 +147,19 @@ def _is_bundle_id(value: object) -> bool:
)
+# A short, ordered list of config file names; more than a handful is not one.
+_MAX_CONFIG_FILES = 8
+
+
+def _is_file_name_list(value: object) -> bool:
+ return (
+ isinstance(value, list)
+ and 0 < len(value) <= _MAX_CONFIG_FILES
+ and all(_is_file_name(item) for item in value)
+ and len(set(value)) == len(value)
+ )
+
+
def _is_rollback_hook(value: object) -> bool:
return value is None or (_is_relative_path(value) and str(value).endswith(".py"))
@@ -143,6 +169,7 @@ _FIELD_CHECKS = (
("launcher_module", _is_module_name),
("version_file", _is_relative_path),
("config_file", _is_file_name),
+ ("config_files", _is_file_name_list),
("macos_app_dir_name", _is_app_dir_name),
("macos_bundle_id", _is_bundle_id),
("rollback_hook", _is_rollback_hook),
@@ -176,7 +203,7 @@ def parse_update_contract(text: str) -> UpdateContract:
)
return DEFAULT_CONTRACT
- stated: dict[str, str | None] = {}
+ stated: dict[str, object] = {}
for name, is_valid in _FIELD_CHECKS:
if name not in payload:
continue
@@ -186,7 +213,10 @@ def parse_update_contract(text: str) -> UpdateContract:
"update contract has an invalid %s; using the default locations", name
)
return DEFAULT_CONTRACT
- stated[name] = value
+ stated[name] = tuple(value) if isinstance(value, list) else value
+ if "config_file" in stated and "config_files" not in stated:
+ # A release from before the list names exactly one file.
+ stated["config_files"] = (stated["config_file"],)
return replace(DEFAULT_CONTRACT, **stated)
diff --git a/dodaios/costs/cli_usage_index.py b/dodaios/costs/cli_usage_index.py
index bb369f175d..5cbb882715 100644
--- a/dodaios/costs/cli_usage_index.py
+++ b/dodaios/costs/cli_usage_index.py
@@ -585,7 +585,19 @@ def _account_roots(platform: str) -> list[Path]:
roots.extend(p for p in folder.iterdir() if p.is_dir())
except Exception as exc: # noqa: BLE001 — same rule: the scan goes on
log.debug("cli usage index: accounts folder for %s unreadable (%s)", platform, exc)
- return roots
+ # One spelling per directory: a registered account stores the data
+ # directory under the name it had when it was added, the folder scan
+ # above yields today's name, and after the directory moved both reach the
+ # same files through the link left behind. The real path is the key.
+ return [_real_root(root) for root in roots]
+
+
+def _real_root(root: Path) -> Path:
+ try:
+ return Path(os.path.realpath(root))
+ except (OSError, ValueError):
+ # Unresolvable (gone, bad drive): the spelling given is the only one.
+ return root
def _dedup_paths(paths: list[Path]) -> list[Path]:
diff --git a/dodaios/dictation/local_preview.py b/dodaios/dictation/local_preview.py
index f4d94c4794..807d0168a0 100644
--- a/dodaios/dictation/local_preview.py
+++ b/dodaios/dictation/local_preview.py
@@ -103,10 +103,10 @@ def faster_whisper_available() -> bool:
def _child_python() -> str:
"""The interpreter for the preview worker, beside the running executable.
- ``sys.executable`` in the desktop app is the branded ``PersonalJarvis.exe``,
+ ``sys.executable`` in the desktop app is the branded ``DodaiosApp.exe``,
which cannot take ``-m``. Usually the real ``python(.exe)`` lives in the
same directory, but the per-user branded copy in
- ``%LOCALAPPDATA%\\PersonalJarvis\\bin`` carries only the runtime DLLs — so
+ ``%LOCALAPPDATA%\\DodaiosApp\\bin`` carries only the runtime DLLs — so
the active environment's own interpreter directory, then the base
install's, are searched next. Without that fallback every dictation after
a launch through that copy failed with "no local dictation worker".
diff --git a/dodaios/missions/kontrollierer/deliverable.py b/dodaios/missions/kontrollierer/deliverable.py
index f15014e49a..1ea6466f50 100644
--- a/dodaios/missions/kontrollierer/deliverable.py
+++ b/dodaios/missions/kontrollierer/deliverable.py
@@ -39,6 +39,9 @@ from typing import Final
from dodaios.i18n import catalog as i18n_catalog
+from dodaios.core.branding import DELIVERABLES_DIR_NAME, LEGACY_DELIVERABLES_DIR_NAMES
+from dodaios.core.identity_boot import resolve_named_dir
+
from ..stream_evidence import clean_request_body
from .deliverable_paths import is_nondeliverable_scratch
@@ -79,7 +82,9 @@ _TRANSLIT: Final[dict[str, str]] = {
#: actually find them. Lives under the user's Downloads on Windows (the place
#: every file dialog + Explorer sidebar surfaces), grouped in one subfolder so
#: it never clutters Downloads with dozens of loose files.
-_DELIVERABLES_FOLDER_NAME: Final[str] = "Jarvis-Outputs"
+#: The name comes from ``dodaios.core.branding``; a folder under an earlier
+#: name stays in use while it exists, so nothing the user already opens moves.
+_DELIVERABLES_FOLDER_NAME: Final[str] = DELIVERABLES_DIR_NAME
#: TTS templates for the deliverable / delivered summaries, keyed by the
@@ -328,18 +333,28 @@ def materialize_answer_document(
return None
+def _deliverables_folder(parent: Path, *, lower: bool = False) -> Path:
+ """The deliverables folder in ``parent``: one under an earlier name while it exists."""
+ name = _DELIVERABLES_FOLDER_NAME.lower() if lower else _DELIVERABLES_FOLDER_NAME
+ legacy = [old.lower() if lower else old for old in LEGACY_DELIVERABLES_DIR_NAMES]
+ return resolve_named_dir(parent, name, legacy)
+
+
def resolve_deliverables_dir(override: str | None = None) -> Path:
"""Return the user-visible folder mission deliverables are mirrored into.
Resolution order:
* ``override`` (e.g. a future ``[phase6].deliverables_dir`` config key) —
``expanduser`` + ``resolve``, used verbatim.
- * Windows with a real ``~/Downloads``: ``~/Downloads/Jarvis-Outputs``.
- * Windows without Downloads: ``~/Desktop/Jarvis-Outputs``, else
- ``~/Jarvis-Outputs``.
- * Non-Windows / headless (cloud-first VPS): ``~/jarvis-outputs`` — never
+ * Windows with a real ``~/Downloads``: ``~/Downloads/Dodaios-Outputs``.
+ * Windows without Downloads: ``~/Desktop/Dodaios-Outputs``, else
+ ``~/Dodaios-Outputs``.
+ * Non-Windows / headless (cloud-first VPS): ``~/dodaios-outputs`` — never
assumes a Desktop/Downloads or an Explorer.
+ In each place a folder under the earlier name (``Jarvis-Outputs`` /
+ ``jarvis-outputs``) is used instead while it exists.
+
The directory is created (``parents=True, exist_ok=True``). Never raises for
a missing parent; on an unwritable home it falls back to the system temp
dir so a delivery attempt degrades to "somewhere" rather than crashing an
@@ -351,14 +366,14 @@ def resolve_deliverables_dir(override: str | None = None) -> Path:
home = Path.home()
downloads = home / "Downloads"
if downloads.is_dir():
- target = downloads / _DELIVERABLES_FOLDER_NAME
+ target = _deliverables_folder(downloads)
elif (home / "Desktop").is_dir():
- target = home / "Desktop" / _DELIVERABLES_FOLDER_NAME
+ target = _deliverables_folder(home / "Desktop")
else:
- target = home / _DELIVERABLES_FOLDER_NAME
+ target = _deliverables_folder(home)
else:
# Cloud-first: no Explorer, no Downloads assumption on a Linux VPS.
- target = Path.home() / "jarvis-outputs"
+ target = _deliverables_folder(Path.home(), lower=True)
try:
target.mkdir(parents=True, exist_ok=True)
diff --git a/dodaios/platform/permissions.py b/dodaios/platform/permissions.py
index dd7bef2126..9cde6f5df5 100644
--- a/dodaios/platform/permissions.py
+++ b/dodaios/platform/permissions.py
@@ -23,13 +23,14 @@ from pathlib import Path
from typing import Any, Literal
from dodaios.core.branding import (
- MACOS_APP_NAME as APP_NAME,
+ MACOS_APP_DIR_NAMES,
+ MACOS_DMG_BUNDLE_ID,
)
from dodaios.core.branding import (
- MACOS_BUNDLE_ID as EXPECTED_BUNDLE_ID,
+ MACOS_APP_NAME as APP_NAME,
)
from dodaios.core.branding import (
- MACOS_DMG_BUNDLE_ID,
+ MACOS_BUNDLE_ID as EXPECTED_BUNDLE_ID,
)
from . import PlatformName, detect_platform
@@ -615,9 +616,11 @@ class SystemPermissionPort:
if launched_as_bundle and bundle_path:
try:
resolved = Path(bundle_path).resolve()
+ # The bundle's earlier name counts until the rename reached it.
canonical_path = any(
- resolved == (root / f"{APP_NAME}.app").resolve()
+ resolved == (root / name).resolve()
for root in _canonical_app_roots()
+ for name in MACOS_APP_DIR_NAMES
)
except (OSError, ValueError):
# A path that will not resolve is not the canonical bundle
diff --git a/dodaios/plugins/stt/deepgram_api.py b/dodaios/plugins/stt/deepgram_api.py
index bf50d589b3..78f181dfa1 100644
--- a/dodaios/plugins/stt/deepgram_api.py
+++ b/dodaios/plugins/stt/deepgram_api.py
@@ -38,8 +38,9 @@ change the pipeline to be worth anything.
API key resolution order (same convention as every other plugin here):
1. constructor argument
2. ``DEEPGRAM_API_KEY`` env var
- 3. OS credential manager via ``keyring`` (service ``personal-jarvis``,
- username ``deepgram_api_key``) — the name the setup wizard already writes.
+ 3. OS credential manager via ``keyring`` (service ``dodaios``, then the
+ earlier ``personal-jarvis``; username ``deepgram_api_key``) — the name
+ the setup wizard already writes.
Never accept a key from voice/chat input (AP-2).
"""
@@ -133,7 +134,7 @@ class DeepgramSTT:
self._api_key = (
api_key
or os.environ.get("DEEPGRAM_API_KEY", "")
- or _read_keyring_secret(_KEYRING_SERVICE, "deepgram_api_key")
+ or _read_keyring_secret("deepgram_api_key")
)
self._model = model
self._last_used_model = ""
@@ -302,13 +303,17 @@ class DeepgramSTT:
# Helpers (module-private)
# ----------------------------------------------------------------------
-#: The OS credential-store service the host saves keys under. A plugin imports
-#: no ``dodaios.*``, so this restates ``dodaios.core.branding.KEYRING_SERVICE_NAME``;
-#: ``tests/unit/core/test_identity_single_source.py`` pins the two together.
-_KEYRING_SERVICE = "personal-jarvis"
+#: The OS credential-store service the host saves keys under, and the services
+#: earlier versions saved them under (read when the current one has nothing).
+#: A plugin imports no ``dodaios.*``, so this restates
+#: ``dodaios.core.branding.KEYRING_SERVICE_NAME`` and
+#: ``LEGACY_KEYRING_SERVICE_NAMES``;
+#: ``tests/unit/core/test_identity_single_source.py`` pins them together.
+_KEYRING_SERVICE = "dodaios"
+_LEGACY_KEYRING_SERVICES = ("personal-jarvis",)
-def _read_keyring_secret(service: str, username: str) -> str:
+def _read_keyring_secret(username: str) -> str:
"""Best-effort credential-manager lookup. Returns ``""`` on any failure."""
# No dodaios.* import here (plugin purity contract): the host's plugin
# loader installs the process-wide keyring backend — on macOS the
@@ -323,12 +328,27 @@ def _read_keyring_secret(service: str, username: str) -> str:
# vault to read, which is "no key" and is already reported honestly by
# the caller. Logging it on every lookup would be noise, not a finding.
return ""
- try:
- return keyring.get_password(service, username) or ""
- except Exception: # noqa: BLE001 — a locked or absent vault is "no key",
- # which the caller already reports honestly; re-raising here would turn
- # a missing optional credential into a crash.
- return ""
+ for service in (_KEYRING_SERVICE, *_LEGACY_KEYRING_SERVICES):
+ try:
+ value = _read_one(keyring, service, username)
+ except Exception: # noqa: BLE001, S112 — a locked or absent vault is
+ # "no key", which the caller already reports honestly; re-raising
+ # here would turn a missing optional credential into a crash.
+ continue
+ if value:
+ return value
+ return ""
+
+
+def _read_one(keyring: Any, service: str, username: str) -> str | None:
+ """One read that never writes: an earlier service is read, never changed."""
+ if service != _KEYRING_SERVICE:
+ # The host's macOS vault wrapper folds an entry it finds into its
+ # vault on a plain read; its read-only twin leaves the old name alone.
+ peek = getattr(keyring.get_keyring(), "peek_password", None)
+ if callable(peek):
+ return peek(service, username)
+ return keyring.get_password(service, username)
def _content_type_for(filename: str) -> str:
diff --git a/dodaios/plugins/stt/groq_api.py b/dodaios/plugins/stt/groq_api.py
index e12de5ed7b..b7bb648d45 100644
--- a/dodaios/plugins/stt/groq_api.py
+++ b/dodaios/plugins/stt/groq_api.py
@@ -17,8 +17,9 @@ Audio I/O contract (compatible with the Jarvis VAD output):
API key resolution order:
1. constructor argument
2. ``GROQ_API_KEY`` env var
- 3. Windows Credential Manager via ``keyring`` (service ``personal-jarvis``,
- username ``groq_api_key``) — same convention as the rest of Jarvis,
+ 3. The OS credential manager via ``keyring`` (service ``dodaios``, then the
+ earlier ``personal-jarvis``; username ``groq_api_key``) — same convention
+ as the rest of the app,
without importing ``dodaios.*`` (the third-party ``keyring`` package is
a soft dependency; if it is missing the lookup is silently skipped).
@@ -115,7 +116,7 @@ class GroqWhisperAPI:
self._api_key = (
api_key
or os.environ.get("GROQ_API_KEY", "")
- or _read_keyring_secret(_KEYRING_SERVICE, "groq_api_key")
+ or _read_keyring_secret("groq_api_key")
)
self._model = model
self._last_used_model = ""
@@ -328,13 +329,17 @@ class GroqWhisperAPI:
# Helpers (module-private)
# ----------------------------------------------------------------------
-#: The OS credential-store service the host saves keys under. A plugin imports
-#: no ``dodaios.*``, so this restates ``dodaios.core.branding.KEYRING_SERVICE_NAME``;
-#: ``tests/unit/core/test_identity_single_source.py`` pins the two together.
-_KEYRING_SERVICE = "personal-jarvis"
+#: The OS credential-store service the host saves keys under, and the services
+#: earlier versions saved them under (read when the current one has nothing).
+#: A plugin imports no ``dodaios.*``, so this restates
+#: ``dodaios.core.branding.KEYRING_SERVICE_NAME`` and
+#: ``LEGACY_KEYRING_SERVICE_NAMES``;
+#: ``tests/unit/core/test_identity_single_source.py`` pins them together.
+_KEYRING_SERVICE = "dodaios"
+_LEGACY_KEYRING_SERVICES = ("personal-jarvis",)
-def _read_keyring_secret(service: str, username: str) -> str:
+def _read_keyring_secret(username: str) -> str:
"""Best-effort Credential-Manager lookup. Returns ``""`` on any failure."""
# No dodaios.* import here (plugin purity contract): the host's plugin
# loader (dodaios.core.registry.load) installs the process-wide keyring
@@ -346,11 +351,25 @@ def _read_keyring_secret(service: str, username: str) -> str:
import keyring # type: ignore[import-not-found]
except ImportError:
return ""
- try:
- val = keyring.get_password(service, username)
- return val or ""
- except Exception: # noqa: BLE001
- return ""
+ for service in (_KEYRING_SERVICE, *_LEGACY_KEYRING_SERVICES):
+ try:
+ value = _read_one(keyring, service, username)
+ except Exception: # noqa: BLE001, S112 — a locked or absent vault is "no key"
+ continue
+ if value:
+ return value
+ return ""
+
+
+def _read_one(keyring: Any, service: str, username: str) -> str | None:
+ """One read that never writes: an earlier service is read, never changed."""
+ if service != _KEYRING_SERVICE:
+ # The host's macOS vault wrapper folds an entry it finds into its
+ # vault on a plain read; its read-only twin leaves the old name alone.
+ peek = getattr(keyring.get_keyring(), "peek_password", None)
+ if callable(peek):
+ return peek(service, username)
+ return keyring.get_password(service, username)
#: Container extensions these transcription APIs accept. A name outside the
diff --git a/dodaios/realtime/local_server/supervisor.py b/dodaios/realtime/local_server/supervisor.py
index 1b96999bbc..fe02d5c9dd 100644
--- a/dodaios/realtime/local_server/supervisor.py
+++ b/dodaios/realtime/local_server/supervisor.py
@@ -2178,17 +2178,27 @@ def _path_is_within_root(value: str, root: Path) -> bool:
def _lexical_path_is_within_root(value: str, root: Path) -> bool:
- """Containment without dereferencing a POSIX venv interpreter symlink."""
+ """Containment without dereferencing a POSIX venv interpreter symlink.
+
+ A root inside the per-user data directory is tried under every name that
+ directory has had: a server started before the directory moved still
+ reports its executable under the old spelling.
+ """
text = (value or "").strip().strip("\"'")
if not text or not Path(text).is_absolute():
return False
+ from dodaios.core.identity_boot import data_dir_spellings
+
candidate = os.path.normcase(os.path.abspath(text))
- root_text = os.path.normcase(os.path.abspath(root))
- try:
- return os.path.commonpath((candidate, root_text)) == root_text
- except ValueError:
- # Paths on different drives/roots — reported through the returned False.
- return False
+ for spelling in data_dir_spellings(root):
+ root_text = os.path.normcase(os.path.abspath(spelling))
+ try:
+ if os.path.commonpath((candidate, root_text)) == root_text:
+ return True
+ except ValueError:
+ # Paths on different drives/roots — this spelling does not contain it.
+ continue
+ return False
def _process_identity_is_managed(exe: str, cmdline: tuple[str, ...], root: Path) -> bool:
diff --git a/dodaios/setup/cli_path.py b/dodaios/setup/cli_path.py
index fa96f168c1..e71454e76f 100644
--- a/dodaios/setup/cli_path.py
+++ b/dodaios/setup/cli_path.py
@@ -34,20 +34,23 @@ from __future__ import annotations
import os
import shutil
import sys
-from collections.abc import Callable, Mapping
+from collections.abc import Callable, Iterable, Mapping
from dataclasses import dataclass, field
from pathlib import Path
from dodaios.core.branding import (
CLI_COMMAND_NAMES,
FISH_CONF_FILE_NAME,
+ LEGACY_DEFAULT_INSTALL_DIR_NAMES,
SHELL_PROFILE_MARKER,
)
+from dodaios.core.identity_migration import LegacyState, inspect_legacy
#: Every command the install exposes: ``dodaios`` and ``dodaiosctl``, then the
#: earlier names of the two (``jarvis``, ``personal-jarvis``, ``jarvisctl``).
-#: There is no ``personaljarvis``: on Windows it would be the same file as the
-#: branded launcher ``PersonalJarvis.exe`` (``dodaios/ui/icon_utils.py``).
+#: There is no ``dodaiosapp`` or ``personaljarvis``: on Windows either would be
+#: the same file as the branded launcher ``DodaiosApp.exe`` or its earlier name
+#: ``PersonalJarvis.exe`` (``dodaios/ui/icon_utils.py``).
COMMAND_NAMES: tuple[str, ...] = CLI_COMMAND_NAMES
#: First line of the block written into a shell profile. Finding it means the
@@ -84,6 +87,8 @@ class CliPathReport:
needs_new_terminal: bool = False
#: Another command of the same name that will win over ours on PATH.
shadowed_by: dict[str, str] = field(default_factory=dict)
+ #: Bin folders of a retired install folder taken off the Windows Path.
+ path_retired: list[str] = field(default_factory=list)
# --------------------------------------------------------------------------- #
@@ -107,6 +112,28 @@ def entry_point(root: Path, command: str, *, platform_name: str | None = None) -
return root / ".venv" / "bin" / command
+def retired_install_roots(root: Path, *, home: Path | None = None) -> list[Path]:
+ """Install folders under an earlier name that are no longer an install of their own.
+
+ After the install folder moved to its current name, the earlier path is a
+ link to it (or gone), and whatever that path put on PATH belongs to this
+ install to retire. A real directory under the earlier name is another
+ install, still in use, and is never listed.
+ """
+ home = home or Path.home()
+ here = os.path.normcase(os.path.abspath(root))
+ retired: list[Path] = []
+ for name in LEGACY_DEFAULT_INSTALL_DIR_NAMES:
+ legacy = home / name
+ if os.path.normcase(os.path.abspath(legacy)) == here:
+ # The install still lives under its earlier name.
+ continue
+ state = inspect_legacy(legacy, root)
+ if state in (LegacyState.ABSENT, LegacyState.LINK_TO_CURRENT, LegacyState.DANGLING_LINK):
+ retired.append(legacy)
+ return retired
+
+
def _path_entries(environ: Mapping[str, str], platform_name: str | None) -> list[str]:
raw = environ.get("PATH") or environ.get("Path") or ""
sep = ";" if is_windows(platform_name) else os.pathsep
@@ -323,8 +350,14 @@ def install_commands(
store: UserPathStore | None = None,
which: Callable[..., str | None] = shutil.which,
dry_run: bool = False,
+ retired_roots: Iterable[Path] = (),
) -> CliPathReport:
- """Make every :data:`COMMAND_NAMES` entry a terminal command."""
+ """Make every :data:`COMMAND_NAMES` entry a terminal command.
+
+ ``retired_roots`` are earlier locations of this install
+ (:func:`retired_install_roots`): on Windows their bin folders leave the
+ per-user Path before this one joins it.
+ """
platform_name = platform_name or sys.platform
home = home or Path.home()
environ = os.environ if environ is None else environ
@@ -356,6 +389,12 @@ def install_commands(
continue
link = target_dir / command
if link.is_symlink() and link.resolve() == source.resolve():
+ # Ours already. One that reaches the command through an
+ # earlier folder name (a link left by the folder's move) is
+ # pointed at the folder itself, so it outlives that link.
+ if os.readlink(link) != str(source):
+ link.unlink()
+ link.symlink_to(source)
report.linked.append(command)
continue
if link.exists() or link.is_symlink():
@@ -371,7 +410,14 @@ def install_commands(
try:
if windows:
- if add_to_user_path(target_dir, store or UserPathStore()):
+ store = store or UserPathStore()
+ for retired in retired_roots:
+ old_bin = bin_dir(retired, platform_name=platform_name, home=home)
+ if _same_dir(str(old_bin), str(target_dir), windows=True):
+ continue
+ if remove_from_user_path(old_bin, store):
+ report.path_retired.append(str(old_bin))
+ if add_to_user_path(target_dir, store):
report.path_updated = "HKCU\\Environment\\Path"
report.needs_new_terminal = not _on_path(target_dir, environ, platform_name)
elif not _on_path(target_dir, environ, platform_name):
@@ -402,15 +448,25 @@ def remove_commands(
platform_name: str | None = None,
home: Path | None = None,
store: UserPathStore | None = None,
+ retired_roots: Iterable[Path] = (),
) -> list[str]:
- """Undo :func:`install_commands`. Returns one line per removed item."""
+ """Undo :func:`install_commands`. Returns one line per removed item.
+
+ ``retired_roots`` are earlier locations of this install, whose Windows
+ Path entries go too.
+ """
platform_name = platform_name or sys.platform
home = home or Path.home()
target_dir = bin_dir(root, platform_name=platform_name, home=home)
removed: list[str] = []
if is_windows(platform_name):
- if remove_from_user_path(target_dir, store or UserPathStore()):
- removed.append(f"{target_dir} removed from your Path")
+ store = store or UserPathStore()
+ for directory in (
+ target_dir,
+ *(bin_dir(retired, platform_name=platform_name) for retired in retired_roots),
+ ):
+ if remove_from_user_path(directory, store):
+ removed.append(f"{directory} removed from your Path")
# The folder itself lives inside the install folder and goes with it.
return removed
for command in COMMAND_NAMES:
@@ -445,4 +501,5 @@ __all__ = [
"remove_commands",
"remove_from_user_path",
"remove_profile_block",
+ "retired_install_roots",
]
diff --git a/dodaios/setup/desktop_integration.py b/dodaios/setup/desktop_integration.py
index 5c60ebf31a..c6d25a205e 100644
--- a/dodaios/setup/desktop_integration.py
+++ b/dodaios/setup/desktop_integration.py
@@ -7,8 +7,13 @@ working process which the operating system does not consider an installed app.
This module owns the external, per-user artifacts as one lifecycle:
* Windows: Start-menu launcher, AppUserModel identity, and Installed Apps entry.
-* macOS: ``~/Applications/Personal Jarvis.app``.
-* Linux: ``$XDG_DATA_HOME/applications/personal-jarvis.desktop``.
+ A launcher under the product's earlier name is retired once the current one
+ is in place, and only where it starts this installation.
+* macOS: ``/Applications/Dodaios.app`` (``~/Applications`` for a standard account).
+* Linux: ``$XDG_DATA_HOME/applications/dodaios.desktop``. An entry under the
+ earlier name (``personal-jarvis.desktop``) is retired the same way as the
+ Windows launcher: once the current one is in place, and only where it starts
+ this installation.
Installer, updater, first desktop boot, and uninstaller all call this module so
an update cannot move the code while leaving its launcher behind. Registration
@@ -35,12 +40,16 @@ import logging
import os
import subprocess
import sys
+from collections.abc import Callable, Iterable
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Any
from dodaios.core.branding import (
LAUNCHER_ENTRY_NAME,
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
LINUX_DESKTOP_ENTRY_FILE_NAME,
OFFICIAL_REPO_URL,
PRODUCT_NAME,
@@ -50,6 +59,9 @@ from dodaios.core.branding import (
from dodaios.core.branding import (
MANAGED_INSTALL_MARKER as MANAGED_MARKER,
)
+from dodaios.core.branding import (
+ MANAGED_INSTALL_MARKERS as MANAGED_MARKERS,
+)
from dodaios.core.branding import (
WINDOWS_UNINSTALL_REGISTRY_SUBKEY as WINDOWS_UNINSTALL_SUBKEY,
)
@@ -113,9 +125,12 @@ def _platform(value: str | None = None) -> str:
def is_managed_install(install_dir: Path) -> bool:
- """Return whether ``install_dir`` was created by the public installer."""
+ """Return whether ``install_dir`` was created by the public installer.
- return (install_dir / MANAGED_MARKER).is_file()
+ The installer's marker counts under any of its names.
+ """
+
+ return any((install_dir / name).is_file() for name in MANAGED_MARKERS)
def _windows_uninstall_script(install_dir: Path) -> Path:
@@ -258,12 +273,102 @@ def _remove_shell_launcher(path: Path) -> str | None:
return None
+def read_windows_shortcut_target(lnk: Path) -> str | None:
+ """The program a ``.lnk`` starts, or ``None`` when it cannot be read."""
+ try:
+ from win32com.client import Dispatch # type: ignore[import-not-found]
+ except Exception: # noqa: BLE001 - no pywin32: the shortcut stays
+ return None
+ try:
+ return str(Dispatch("WScript.Shell").CreateShortcut(str(lnk)).TargetPath or "")
+ except Exception as exc: # noqa: BLE001 - unreadable: the shortcut stays
+ log.debug("could not read the shortcut %s: %s", lnk, exc)
+ return None
+
+
+def _same_file(first: str | Path, second: str | Path) -> bool:
+ return os.path.normcase(os.path.realpath(first)) == os.path.normcase(
+ os.path.realpath(second)
+ )
+
+
+def _shortcut_starts_this_install(
+ target: str, *, install_root: Path | None, launch_target: Path | None
+) -> bool:
+ """Does a shortcut aimed at ``target`` start THIS installation?
+
+ It does when the program lies inside the install folder, or when it is the
+ program this install's own launcher starts, the branded executable under an
+ earlier name beside it, or the interpreter that executable was copied from.
+ Anything else (another checkout, another installation, a file a person
+ pointed it at) is not ours.
+ """
+ if not target:
+ return False
+ if install_root is not None:
+ root = os.path.normcase(os.path.realpath(install_root))
+ program = os.path.normcase(os.path.realpath(target))
+ if program.startswith(root.rstrip("\\/") + os.sep):
+ return True
+ if launch_target is None:
+ return False
+ candidates = [
+ launch_target,
+ launch_target.with_name("pythonw.exe"),
+ *(launch_target.with_name(name) for name in LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES),
+ ]
+ return any(_same_file(target, candidate) for candidate in candidates)
+
+
+def retire_legacy_windows_launchers(
+ directories: Iterable[Path | None],
+ *,
+ install_root: Path | None = None,
+ launch_target: Path | None = None,
+ read_target: Callable[[Path], str | None] = read_windows_shortcut_target,
+ remove: Callable[[Path], str | None] | None = None,
+) -> tuple[tuple[Path, ...], tuple[str, ...]]:
+ """Remove the earlier-named shortcuts in ``directories`` that start this install.
+
+ The product's launcher used to be ``Personal Jarvis.lnk``; the current one
+ has its own name, so both would sit in the Start menu and on the Desktop. A
+ shortcut under the earlier name is removed only when it starts this
+ installation (:func:`_shortcut_starts_this_install`), and is kept whenever
+ its target cannot be read. Returns the removed paths and the failures.
+ """
+ remove = remove or _remove_shell_launcher
+ removed: list[Path] = []
+ failures: list[str] = []
+ for directory in directories:
+ if directory is None:
+ continue
+ for name in LEGACY_WINDOWS_SHORTCUT_FILE_NAMES:
+ lnk = directory / name
+ if not lnk.is_file():
+ continue
+ target = read_target(lnk)
+ if target is None or not _shortcut_starts_this_install(
+ target, install_root=install_root, launch_target=launch_target
+ ):
+ log.info("Kept %s: it does not start this installation.", lnk)
+ continue
+ failure = remove(lnk)
+ if failure is None:
+ removed.append(lnk)
+ log.info("Removed the launcher under the earlier name: %s", lnk)
+ else:
+ failures.append(f"could not remove {lnk.name}: {failure}")
+ return tuple(removed), tuple(failures)
+
+
def _remove_windows_desktop_integration(
*,
programs_dir: Path | None = None,
desktop_dir: Path | None = None,
registry_subkey: str = WINDOWS_UNINSTALL_SUBKEY,
aumid: str = WINDOWS_APP_USER_MODEL_ID,
+ install_root: Path | None = None,
+ read_target: Callable[[Path], str | None] = read_windows_shortcut_target,
) -> tuple[bool, tuple[str, ...]]:
warnings: list[str] = []
programs = programs_dir or _windows_programs_dir()
@@ -277,6 +382,14 @@ def _remove_windows_desktop_integration(
failure = _remove_shell_launcher(desktop / WINDOWS_SHORTCUT_FILE_NAME)
if failure is not None:
warnings.append(f"could not remove the Desktop launcher: {failure}")
+ # A launcher an earlier release left under the earlier name goes too, but
+ # only where it starts this installation.
+ _removed, failures = retire_legacy_windows_launchers(
+ (programs, desktop),
+ install_root=install_root or _install_root(),
+ read_target=read_target,
+ )
+ warnings.extend(failures)
if not _delete_windows_registry_key(registry_subkey):
warnings.append("could not remove the Installed Apps registry entry")
if not _delete_windows_registry_key(_windows_aumid_subkey(aumid)):
@@ -290,16 +403,26 @@ def _linux_applications_dir() -> Path:
return base / "applications"
-def _remove_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
- entry = (
- applications_dir or _linux_applications_dir()
- ) / LINUX_DESKTOP_ENTRY_FILE_NAME
+def _remove_linux_desktop_entry(
+ applications_dir: Path | None = None, *, install_root: Path | None = None
+) -> bool:
+ """Remove the menu entry, and an earlier-named one where it starts this install."""
+ directory = applications_dir or _linux_applications_dir()
+ entry = directory / LINUX_DESKTOP_ENTRY_FILE_NAME
try:
entry.unlink(missing_ok=True)
- return True
except OSError as exc:
log.warning("Linux application-menu cleanup failed: %s", exc)
return False
+ from dodaios.autostart.linux import remove_entries_of_install
+
+ _removed, failures = remove_entries_of_install(
+ [directory / name for name in LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES],
+ str(install_root or _install_root()),
+ )
+ for failure in failures:
+ log.warning("Linux application-menu cleanup failed: %s", failure)
+ return not failures
def _linux_gui_available(applications_dir: Path | None) -> bool:
@@ -317,6 +440,7 @@ def ensure_desktop_integration(
windows_desktop_dir: Path | None = None,
windows_registry_subkey: str = WINDOWS_UNINSTALL_SUBKEY,
windows_aumid: str = WINDOWS_APP_USER_MODEL_ID,
+ windows_shortcut_target_reader: Callable[[Path], str | None] = read_windows_shortcut_target,
macos_applications_dir: Path | None = None,
linux_applications_dir: Path | None = None,
macos_create_signing_identity: bool = False,
@@ -373,12 +497,14 @@ def ensure_desktop_integration(
)
icon = project_icon_path()
+ launchers_in_place: list[Path | None] = []
if ensure_start_menu_shortcut(
aumid=windows_aumid,
icon_path=icon if icon.is_file() else None,
programs_dir=windows_programs_dir,
):
artifacts.append("start_menu_launcher")
+ launchers_in_place.append(windows_programs_dir or _windows_programs_dir())
else:
warnings.append("could not create the Start-menu launcher")
# The Desktop entry is the one Windows Search can actually see: the
@@ -391,8 +517,19 @@ def ensure_desktop_integration(
desktop_dir=windows_desktop_dir,
):
artifacts.append("desktop_launcher")
+ launchers_in_place.append(windows_desktop_dir or _windows_desktop_dir())
else:
warnings.append("could not create the Desktop launcher")
+ # Only where the current launcher now exists: the user is never
+ # left without a way to start the app.
+ retired, failures = retire_legacy_windows_launchers(
+ launchers_in_place,
+ install_root=root,
+ read_target=windows_shortcut_target_reader,
+ )
+ if retired:
+ artifacts.append("retired_legacy_launchers")
+ warnings.extend(failures)
if register_windows_app_user_model_id(
windows_aumid,
icon_path=icon if icon.is_file() else None,
@@ -479,6 +616,7 @@ def remove_desktop_integration(
windows_desktop_dir: Path | None = None,
windows_registry_subkey: str = WINDOWS_UNINSTALL_SUBKEY,
windows_aumid: str = WINDOWS_APP_USER_MODEL_ID,
+ windows_shortcut_target_reader: Callable[[Path], str | None] = read_windows_shortcut_target,
macos_applications_dir: Path | None = None,
linux_applications_dir: Path | None = None,
) -> DesktopIntegrationReport:
@@ -514,6 +652,7 @@ def remove_desktop_integration(
desktop_dir=windows_desktop_dir,
registry_subkey=windows_registry_subkey,
aumid=windows_aumid,
+ read_target=windows_shortcut_target_reader,
)
artifacts.extend(
(
@@ -615,11 +754,14 @@ __all__ = [
"DesktopIntegrationReport",
"FROZEN_SKIP_REASON",
"MANAGED_MARKER",
+ "MANAGED_MARKERS",
"WINDOWS_APP_USER_MODEL_ID",
"WINDOWS_UNINSTALL_SUBKEY",
"ensure_desktop_integration",
"is_managed_install",
"register_windows_installed_app",
+ "read_windows_shortcut_target",
"remove_desktop_integration",
+ "retire_legacy_windows_launchers",
"windows_uninstall_values",
]
diff --git a/dodaios/setup/macos_app_bundle.py b/dodaios/setup/macos_app_bundle.py
index c75958c5a7..ad7137b3f4 100644
--- a/dodaios/setup/macos_app_bundle.py
+++ b/dodaios/setup/macos_app_bundle.py
@@ -3,7 +3,7 @@
The bundle's main executable must remain a Mach-O process. A shell launcher
that ``exec``s an external virtual-environment Python loses its ``NSBundle``
identity and causes TCC grants to attach to Python or a terminal instead of
-Personal Jarvis. The managed installer therefore compiles the in-repo stub
+the app. The managed installer therefore compiles the in-repo stub
launcher (``macos_stub_launcher.c``): it embeds the active Python runtime in
the app process and runs the managed entry script, so it works with framework
AND non-framework interpreters (for example uv-managed standalone builds)
@@ -43,6 +43,12 @@ import tempfile
from pathlib import Path
from types import ModuleType
+from dodaios.core.branding import (
+ LEGACY_MACOS_APP_DIR_NAMES,
+ MACOS_APP_DIR_NAMES,
+ MACOS_DMG_BUNDLE_ID,
+ MACOS_EXECUTABLE_NAME,
+)
from dodaios.core.branding import (
MACOS_APP_DIR_NAME as APP_DIR_NAME,
)
@@ -52,10 +58,6 @@ from dodaios.core.branding import (
from dodaios.core.branding import (
MACOS_BUNDLE_ID as BUNDLE_ID,
)
-from dodaios.core.branding import (
- MACOS_DMG_BUNDLE_ID,
- MACOS_EXECUTABLE_NAME,
-)
from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
from dodaios.setup.macos_signing_identity import ensure_local_signing_identity
@@ -202,7 +204,7 @@ def _bundle_identifier(candidate: Path) -> str | None:
def _is_foreign_bundle(candidate: Path) -> bool:
"""Whether ``candidate`` is an app of the same NAME that is not ours.
- The notarized DMG build is also called ``Personal Jarvis.app`` and is
+ The notarized DMG build carries the same name and is
dragged to ``/Applications`` by hand, under its own bundle id. It is the
user's app, not this installer's: it must never be taken for the managed
bundle, replaced by a rebuild, or deleted by an uninstall. Only a readable
@@ -225,10 +227,12 @@ def installed_macos_app_bundle_path() -> Path:
managed = macos_app_bundle_path()
if managed.is_dir():
return managed
+ # A .dmg app the in-app updater has not reached yet keeps its earlier name.
for root in (SYSTEM_APPLICATIONS_DIR, user_applications_dir()):
- candidate = root / APP_DIR_NAME
- if candidate.is_dir() and _bundle_identifier(candidate) == MACOS_DMG_BUNDLE_ID:
- return candidate
+ for name in MACOS_APP_DIR_NAMES:
+ candidate = root / name
+ if candidate.is_dir() and _bundle_identifier(candidate) == MACOS_DMG_BUNDLE_ID:
+ return candidate
return managed
@@ -238,6 +242,49 @@ def macos_app_bundle_path(*, applications_dir: Path | None = None) -> Path:
return root / APP_DIR_NAME
+def rename_legacy_macos_app_bundles(roots: tuple[Path, ...] | None = None) -> list[Path]:
+ """Give our bundle under an earlier name the current name, once.
+
+ One ``os.rename`` in the folder it lives in: every byte stays, and with
+ them the code signature, so the privacy grants survive it (TCC pins them to
+ the bundle id and the signing requirement, never to a path, BUG-161). No
+ link is left under the earlier name: Launchpad and Spotlight would list the
+ app twice. A process that runs from the bundle keeps running; it still
+ reports the path it started from, which the repair below allows for.
+
+ Only a bundle whose ``Info.plist`` names the managed bundle id is renamed.
+ An unreadable one proves nothing, and the .dmg app (its own id) is renamed
+ by its own updater (``dodaios.core.installer_update``), which swaps the
+ bundle it runs from and must find it where it started. A folder that
+ already holds an app under the current name keeps both untouched. Returns
+ the bundles now under the current name; never raises.
+ """
+ renamed: list[Path] = []
+ for root in roots or (SYSTEM_APPLICATIONS_DIR, user_applications_dir()):
+ target = root / APP_DIR_NAME
+ for legacy_name in LEGACY_MACOS_APP_DIR_NAMES:
+ source = root / legacy_name
+ try:
+ if source.is_symlink() or not source.is_dir():
+ continue
+ if _bundle_identifier(source) != BUNDLE_ID:
+ log.info("Keeping %s under its name: it is not this install's app.", source)
+ continue
+ if target.exists() or target.is_symlink():
+ log.warning(
+ "Keeping %s under its earlier name: %s already exists.", source, target
+ )
+ continue
+ os.rename(source, target)
+ except OSError as exc:
+ log.warning("Could not rename %s to %s; keeping it: %s", source, target, exc)
+ continue
+ log.info("Renamed the macOS app %s to %s.", source, target)
+ unregister_from_launch_services(source)
+ renamed.append(target)
+ return renamed
+
+
def _promote_to_system_applications(
*, system_dir: Path | None = None, user_dir: Path | None = None
) -> Path | None:
@@ -628,7 +675,7 @@ def register_with_launch_services(bundle: Path) -> bool:
def unregister_from_launch_services(bundle: Path) -> bool:
"""Drop ``bundle`` from the LaunchServices database.
- A deleted or moved app otherwise lingers as a second "Personal Jarvis" in
+ A deleted or moved app otherwise lingers as a second copy of the app in
"Open With" and as a dead target for ``open -b`` until the next database
rebuild. Works on a path that no longer exists. Best-effort, never raises.
"""
@@ -1120,37 +1167,50 @@ def _install_native_bundle(
return bundle
-def _bundle_version(bundle: Path) -> str | None:
+def _bundle_metadata_is_current(bundle: Path) -> bool:
+ """Whether the bundle's ``Info.plist`` names this version and this app name."""
try:
with (bundle / "Contents" / "Info.plist").open("rb") as stream:
- version = plistlib.load(stream).get("CFBundleShortVersionString")
+ info = plistlib.load(stream)
except (OSError, ValueError, plistlib.InvalidFileException):
- # An unreadable plist has no usable version.
- return None
- return version if isinstance(version, str) else None
+ # An unreadable plist has no usable metadata.
+ return False
+ return (
+ info.get("CFBundleShortVersionString") == _version()
+ and info.get("CFBundleName") == APP_NAME
+ and info.get("CFBundleDisplayName") == APP_NAME
+ )
-def _stamp_current_version(staged: Path) -> None:
+def _stamp_current_metadata(staged: Path) -> None:
info_path = staged / "Contents" / "Info.plist"
with info_path.open("rb") as stream:
info = plistlib.load(stream)
info["CFBundleShortVersionString"] = _version()
info["CFBundleVersion"] = _version()
+ # The name the menu bar shows; a bundle built under an earlier name still
+ # carries that one after the folder was renamed.
+ info["CFBundleName"] = APP_NAME
+ info["CFBundleDisplayName"] = APP_NAME
with info_path.open("wb") as stream:
plistlib.dump(info, stream)
-def _refresh_bundle_version(bundle: Path, identity: str) -> Path:
- """Make Finder's "Get Info" show the version that is actually installed.
+def _refresh_bundle_metadata(bundle: Path, identity: str) -> Path:
+ """Make Finder's "Get Info" and the menu bar show what is actually installed.
The bundle is kept across source updates, so its ``Info.plist`` froze at
- the version that first built it. Under the certificate identity the code
- requirement does not depend on the bundle's bytes, so the metadata can be
- brought up to date without costing a single permission. An ad-hoc bundle
- is never touched here — for it, any new signature is a new TCC identity.
+ the version and the name that first built it. Under the certificate
+ identity the code requirement does not depend on the bundle's bytes, so the
+ metadata can be brought up to date without costing a single permission. An
+ ad-hoc bundle is never touched here — for it, any new signature is a new
+ TCC identity; it keeps the earlier name inside until a rebuild that happens
+ for another reason.
"""
- refreshed = _resign_bundle_in_place(bundle, identity, prepare=_stamp_current_version)
- log.info("macOS app bundle metadata updated to version %s: %s", _version(), bundle)
+ refreshed = _resign_bundle_in_place(bundle, identity, prepare=_stamp_current_metadata)
+ log.info(
+ "macOS app bundle metadata updated to %s %s: %s", APP_NAME, _version(), bundle
+ )
return refreshed
@@ -1240,10 +1300,12 @@ def _ensure_macos_app_bundle(
applications_dir: Path | None = None,
create_signing_identity: bool = False,
) -> Path | None:
- """Ensure ``/Applications/Personal Jarvis.app`` has a stable identity.
+ """Ensure ``/Applications/<APP_DIR_NAME>`` has a stable identity.
``~/Applications`` is used instead when this account cannot write
- ``/Applications``; an existing install there is moved over once.
+ ``/Applications``; an existing install there is moved over once, and a
+ bundle under an earlier name is renamed once
+ (``rename_legacy_macos_app_bundles``).
A valid existing bundle is preserved byte-for-byte so normal source
updates cannot churn its local TCC identity. ``create_signing_identity``
@@ -1258,8 +1320,11 @@ def _ensure_macos_app_bundle(
if sys.platform != "darwin":
log.info("App bundle skipped: only macOS uses .app bundles.")
return None
+ rename_legacy_macos_app_bundles()
_promote_to_system_applications()
applications_dir = macos_applications_dir()
+ else:
+ rename_legacy_macos_app_bundles((applications_dir,))
try:
install_root = (install_dir or _default_install_dir()).resolve()
bundle = macos_app_bundle_path(applications_dir=applications_dir)
@@ -1285,7 +1350,8 @@ def _ensure_macos_app_bundle(
running = _running_managed_bundle(install_root=install_root, diagnostics=diagnostics)
if running is not None and not running.exists() and bundle.exists():
# This process still carries the path it launched from, but the
- # bundle was just moved (``_promote_to_system_applications``).
+ # bundle was just moved or renamed (``_promote_to_system_applications``,
+ # ``rename_legacy_macos_app_bundles``).
running = bundle
if running is not None:
register_with_launch_services(running)
@@ -1311,8 +1377,8 @@ def _ensure_macos_app_bundle(
register_with_launch_services(resigned)
_record_rebuild(resigned, install_root=install_root, identity=identity)
return resigned
- if identity is not None and _bundle_version(bundle) != _version():
- bundle = _refresh_bundle_version(bundle, identity)
+ if identity is not None and not _bundle_metadata_is_current(bundle):
+ bundle = _refresh_bundle_metadata(bundle, identity)
# A healthy bundle is kept byte-for-byte, but LaunchServices may
# still not know it — an interrupted earlier run, or a database
# rebuilt since. Re-registering is a no-op when it is known, and
@@ -1364,7 +1430,8 @@ def remove_macos_app_bundle(*, applications_dir: Path | None = None) -> bool:
"""Delete the bundle on uninstall and report whether it is gone.
Without an explicit directory both install locations are cleared, so an
- app the installer moved or the user dragged elsewhere is not left behind.
+ app the installer moved or the user dragged elsewhere is not left behind,
+ under its current name and every earlier one.
"""
if applications_dir is None:
if sys.platform != "darwin":
@@ -1374,19 +1441,22 @@ def remove_macos_app_bundle(*, applications_dir: Path | None = None) -> bool:
roots = [applications_dir]
removed = True
for root in roots:
- bundle = root / APP_DIR_NAME
- if not bundle.exists() and not bundle.is_symlink():
- continue
- if _is_foreign_bundle(bundle):
- log.info("Keeping %s: it is a separately installed app, not this install's.", bundle)
- continue
- try:
- _remove_path(bundle)
- unregister_from_launch_services(bundle)
- log.info("macOS app bundle removed: %s", bundle)
- except OSError as exc:
- log.warning("Could not remove %s: %s", bundle, exc)
- removed = False
+ for name in MACOS_APP_DIR_NAMES:
+ bundle = root / name
+ if not bundle.exists() and not bundle.is_symlink():
+ continue
+ if _is_foreign_bundle(bundle):
+ log.info(
+ "Keeping %s: it is a separately installed app, not this install's.", bundle
+ )
+ continue
+ try:
+ _remove_path(bundle)
+ unregister_from_launch_services(bundle)
+ log.info("macOS app bundle removed: %s", bundle)
+ except OSError as exc:
+ log.warning("Could not remove %s: %s", bundle, exc)
+ removed = False
return removed
@@ -1405,5 +1475,6 @@ __all__ = [
"macos_launch_services_command",
"register_with_launch_services",
"remove_macos_app_bundle",
+ "rename_legacy_macos_app_bundles",
"unregister_from_launch_services",
]
diff --git a/dodaios/setup/macos_dock.py b/dodaios/setup/macos_dock.py
index a19263b6d6..43718772c8 100644
--- a/dodaios/setup/macos_dock.py
+++ b/dodaios/setup/macos_dock.py
@@ -20,7 +20,7 @@ import sys
from pathlib import Path
from urllib.parse import unquote, urlparse
-from dodaios.core.branding import MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID
+from dodaios.core.branding import MACOS_APP_DIR_NAMES, MACOS_BUNDLE_ID
from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
log = logging.getLogger(__name__)
@@ -72,7 +72,8 @@ def is_our_tile(tile: dict) -> bool:
"""Whether a Dock tile is the managed app, wherever it points.
Matches the bundle id the Dock recorded, or — for a tile written before
- the Dock resolved it — the bundle directory name at the end of its URL.
+ the Dock resolved it — the bundle directory name at the end of its URL,
+ current or earlier.
"""
data = tile.get("tile-data")
if not isinstance(data, dict):
@@ -84,7 +85,7 @@ def is_our_tile(tile: dict) -> bool:
if not isinstance(url, str):
return False
path = unquote(urlparse(url).path if "://" in url else url).rstrip("/")
- return Path(path).name == MACOS_APP_DIR_NAME and "bundle-identifier" not in data
+ return Path(path).name in MACOS_APP_DIR_NAMES and "bundle-identifier" not in data
def _tile_for(bundle: Path) -> dict:
diff --git a/dodaios/setup/onboarding_meta.py b/dodaios/setup/onboarding_meta.py
index 87120388af..16ebb84706 100644
--- a/dodaios/setup/onboarding_meta.py
+++ b/dodaios/setup/onboarding_meta.py
@@ -11,7 +11,7 @@ from __future__ import annotations
import logging
from pathlib import Path
-from dodaios.core.branding import DISTRIBUTION_NAME
+from dodaios.core.branding import DISTRIBUTION_NAMES
logger = logging.getLogger(__name__)
@@ -79,9 +79,11 @@ def read_terms_text() -> str:
sysconfig.get_path("data"),
sysconfig.get_path("data", scheme=sysconfig.get_preferred_scheme("user")),
)
+ # A wheel under the earlier distribution name installs under that name.
installed_paths = (
- Path(root) / "share" / DISTRIBUTION_NAME / "docs" / "legal" / "TERMS.md"
+ Path(root) / "share" / distribution / "docs" / "legal" / "TERMS.md"
for root in data_roots
+ for distribution in DISTRIBUTION_NAMES
)
for terms_path in dict.fromkeys((_TERMS_PATH, *installed_paths)):
try:
diff --git a/dodaios/setup/uninstall.py b/dodaios/setup/uninstall.py
index 3a80b941b4..91989291de 100644
--- a/dodaios/setup/uninstall.py
+++ b/dodaios/setup/uninstall.py
@@ -3,16 +3,19 @@
A download leaves FOUR things on a machine, and a plain folder-delete only
gets the first:
-1. **The install folder** (``~/.personal-jarvis``) — code, the Python venv,
- ``jarvis.toml``, ``data/`` and the ``.setup-complete`` marker.
+1. **The install folder** (``~/.dodaios``, ``~/.personal-jarvis`` before the
+ rename) — code, the Python venv, the config file, ``data/`` and the
+ ``.setup-complete`` marker. A folder that moved to its current name left a
+ link at the earlier path; the link is removed as a link, never followed.
2. **Desktop-shell registration** (Windows Start menu + Installed Apps, a
macOS ``.app`` bundle, or a Linux application-menu entry).
3. **A login-autostart entry** next to it (a Windows logon task / a macOS
``LaunchAgent`` / a Linux XDG ``.desktop``) — survives a folder delete and
then points at nothing.
-4. **API keys in the OS keyring** (service ``personal-jarvis`` — Windows
- Credential Manager / macOS Keychain / Linux Secret Service) — survive a
- folder delete, so a fresh install would show them as "already set".
+4. **API keys in the OS keyring** (service ``dodaios``, and ``personal-jarvis``
+ from before the rename — Windows Credential Manager / macOS Keychain / Linux
+ Secret Service) — survive a folder delete, so a fresh install would show
+ them as "already set".
This module removes all four (with an explicit confirmation, a ``--dry-run``
preview and per-item ``--keep-*`` opt-outs) so "download → test → wipe → re-test"
@@ -48,7 +51,9 @@ from rich.panel import Panel
from rich.theme import Theme
from dodaios.core import config as cfg
-from dodaios.core.branding import CONFIG_FILE_NAME
+from dodaios.core.branding import DEFAULT_INSTALL_DIR_NAME, LEGACY_DEFAULT_INSTALL_DIR_NAMES
+from dodaios.core.identity_boot import resolve_config_file
+from dodaios.core.identity_migration import LegacyState, inspect_legacy, is_directory_link
from dodaios.core.process_utils import wait_procs
from dodaios.setup.wizard import SECRETS
@@ -77,10 +82,13 @@ class UninstallPlan:
autostart_entry: str | None
keyring_keys: list[str] = field(default_factory=list)
running_pids: list[int] = field(default_factory=list)
+ #: Links that lead to the install folder from another path (the earlier
+ #: folder name a move left behind). Removed with the folder, as links.
+ install_links: tuple[Path, ...] = ()
@property
def config_file(self) -> Path:
- return self.install_dir / CONFIG_FILE_NAME
+ return resolve_config_file(self.install_dir)
@property
def data_dir(self) -> Path:
@@ -101,6 +109,61 @@ def _looks_like_jarvis_install(path: Path) -> bool:
return False
+def _install_links(install_dir: Path, *, home: Path | None = None) -> tuple[Path, ...]:
+ """Every link that leads to ``install_dir`` from a path an install may have used.
+
+ That is each name the install folder has had in the home directory, and the
+ path this program runs from. Only a link that leads to ``install_dir``
+ itself is listed; a real folder or a link elsewhere is somebody else's.
+ """
+ home = home or Path.home()
+ names = (DEFAULT_INSTALL_DIR_NAME, *LEGACY_DEFAULT_INSTALL_DIR_NAMES)
+ candidates = [Path(cfg.PROJECT_ROOT), *(home / name for name in names)]
+ target = os.path.normcase(os.path.abspath(install_dir))
+ seen = {target}
+ links: list[Path] = []
+ for candidate in candidates:
+ key = os.path.normcase(os.path.abspath(candidate))
+ if key in seen:
+ continue
+ seen.add(key)
+ if inspect_legacy(candidate, install_dir) is LegacyState.LINK_TO_CURRENT:
+ links.append(Path(os.path.abspath(candidate)))
+ return tuple(links)
+
+
+def _remove_link(link: Path) -> None:
+ """Remove a directory link itself, never what it leads to. Raises ``OSError``.
+
+ ``unlink`` removes a symlink; a Windows junction or directory symlink is
+ removed by ``rmdir``, which deletes the link and refuses a real folder that
+ still holds anything. Neither call ever descends into the target.
+ """
+ if not is_directory_link(link):
+ raise OSError(f"{link} is not a link")
+ try:
+ os.unlink(link)
+ except OSError: # A junction refuses unlink; rmdir removes it, and its own error propagates.
+ os.rmdir(link)
+
+
+def _remove_install_links(links: tuple[Path, ...]) -> None:
+ for link in links:
+ try:
+ _remove_link(link)
+ _console.print(f" [ok]→ removed the link {escape(str(link))}.[/]")
+ except OSError as exc:
+ _console.print(
+ f" [bad]⚠ could not remove the link {escape(str(link))}: "
+ f"{escape(str(exc))}[/]"
+ )
+
+
+def _credential_services() -> tuple[str, ...]:
+ """The current credential service and every one an earlier version used."""
+ return (cfg.KEYRING_SERVICE, *cfg.LEGACY_KEYRING_SERVICES)
+
+
def _macos_keychain_item_present(key: str) -> bool | None:
"""Attributes-only macOS Keychain lookup — never decrypts, never prompts.
@@ -109,19 +172,23 @@ def _macos_keychain_item_present(key: str) -> bool | None:
``security find-generic-password`` WITHOUT ``-w`` returns only the item's
attributes, which needs no access to the secret — so probing all secret
slots stays silent. Returns ``None`` when the probe cannot answer (not
- macOS, or ``security`` unavailable) so the caller falls back."""
+ macOS, or ``security`` unavailable) so the caller falls back. Every
+ credential service counts, the legacy ones included."""
if sys.platform != "darwin":
return None
- try:
- res = subprocess.run( # noqa: S603, S607 — fixed argv, no shell
- ["security", "find-generic-password", "-s", cfg.KEYRING_SERVICE, "-a", key],
- capture_output=True,
- timeout=15,
- check=False,
- )
- except Exception: # noqa: BLE001 — probe unavailable → generic fallback
- return None
- return res.returncode == 0
+ for service in _credential_services():
+ try:
+ res = subprocess.run( # noqa: S603, S607 — fixed argv, no shell
+ ["security", "find-generic-password", "-s", service, "-a", key],
+ capture_output=True,
+ timeout=15,
+ check=False,
+ )
+ except Exception: # noqa: BLE001 — probe unavailable → generic fallback
+ return None
+ if res.returncode == 0:
+ return True
+ return False
def _macos_delete_keychain_items(key: str) -> bool:
@@ -132,23 +199,24 @@ def _macos_delete_keychain_items(key: str) -> bool:
dozens of per-item Keychain password dialogs. Duplicate service+account
items can exist across keychains and ``security`` deletes one match per
call — loop with a small safety cap. Returns True when at least one item
- was removed."""
+ was removed. Runs under every credential service, the legacy ones too."""
if sys.platform != "darwin":
return False
gone_any = False
- for _ in range(8):
- try:
- res = subprocess.run( # noqa: S603, S607 — fixed argv, no shell
- ["security", "delete-generic-password", "-s", cfg.KEYRING_SERVICE, "-a", key],
- capture_output=True,
- timeout=15,
- check=False,
- )
- except Exception: # noqa: BLE001 — best effort; delete_secret still runs
- break
- if res.returncode != 0:
- break
- gone_any = True
+ for service in _credential_services():
+ for _ in range(8):
+ try:
+ res = subprocess.run( # noqa: S603, S607 — fixed argv, no shell
+ ["security", "delete-generic-password", "-s", service, "-a", key],
+ capture_output=True,
+ timeout=15,
+ check=False,
+ )
+ except Exception: # noqa: BLE001 — best effort; delete_secret still runs
+ break
+ if res.returncode != 0:
+ break
+ gone_any = True
return gone_any
@@ -158,11 +226,30 @@ def _file_fallback_copy_present(key: str) -> bool:
Saved there when the OS store was declined or locked; reading it never
prompts on any OS."""
try:
- return cfg._FileCredStore().get(cfg.KEYRING_SERVICE, key) is not None
+ store = cfg._FileCredStore()
+ return any(store.get(service, key) is not None for service in _credential_services())
except Exception: # noqa: BLE001 — unreadable fallback counts as absent
return False
+def _uninstall_key_candidates() -> list[str]:
+ """Every credential name worth probing: the wizard's first, then the rest.
+
+ ``dodaios.core.secret_slots`` adds the fixed slots and the names computed
+ at runtime that can be listed (computers, CLIs, plugin tokens, ...).
+ """
+ names = [spec.key for spec in SECRETS]
+ try:
+ from dodaios.core.secret_slots import all_secret_keys
+
+ names.extend(sorted(all_secret_keys()))
+ except Exception as exc: # noqa: BLE001 — the wizard's slots are still probed
+ _console.print(
+ f" [muted]→ some saved-key names could not be listed: {escape(str(exc))}[/]"
+ )
+ return list(dict.fromkeys(names))
+
+
def _keyring_keys_present() -> list[str]:
"""Which of Jarvis's known secret slots are actually stored in the keyring.
@@ -180,22 +267,26 @@ def _keyring_keys_present() -> list[str]:
import keyring
def probe(key: str) -> str | None:
- return keyring.get_password(cfg.KEYRING_SERVICE, key)
+ for service in _credential_services():
+ value = keyring.get_password(service, key)
+ if value:
+ return value
+ return None
except Exception: # noqa: BLE001 — no keyring module → fall back to the getter
def probe(key: str) -> str | None:
return cfg.get_secret(key)
present: list[str] = []
- for spec in SECRETS:
+ for key in _uninstall_key_candidates():
try:
- stored = _macos_keychain_item_present(spec.key)
+ stored = _macos_keychain_item_present(key)
if stored is None:
- stored = bool(probe(spec.key))
- else:
- stored = stored or _file_fallback_copy_present(spec.key)
- if stored:
- present.append(spec.key)
+ stored = bool(probe(key))
+ # A copy in the 0600 file store (a declined or locked OS store)
+ # counts on every OS.
+ if stored or _file_fallback_copy_present(key):
+ present.append(key)
except Exception: # noqa: BLE001, S112 — a single unreadable slot must not abort
continue
return present
@@ -340,6 +431,7 @@ def build_plan() -> UninstallPlan:
autostart_entry=entry,
keyring_keys=_keyring_keys_present(),
running_pids=running,
+ install_links=_install_links(install_dir),
)
@@ -362,6 +454,11 @@ def _print_plan(plan: UninstallPlan, *, keep_keys: bool, keep_folder: bool) -> N
f"[brand]•[/] Delete the install folder:\n [muted]{escape(str(plan.install_dir))}[/]"
)
lines.append(" [muted](code, the Python environment, jarvis.toml, and data folder)[/]")
+ for link in plan.install_links:
+ lines.append(
+ f"[brand]•[/] Remove the link to it (the folder's earlier name):\n"
+ f" [muted]{escape(str(link))}[/]"
+ )
if plan.autostart_entry:
lines.append(
f"[brand]•[/] Remove the login-autostart entry:\n"
@@ -434,9 +531,9 @@ def _remove_cli_commands(install_dir: Path) -> None:
delete would leave dead commands behind.
"""
try:
- from dodaios.setup.cli_path import remove_commands
+ from dodaios.setup.cli_path import remove_commands, retired_install_roots
- removed = remove_commands(install_dir)
+ removed = remove_commands(install_dir, retired_roots=retired_install_roots(install_dir))
if removed:
_console.print(" [ok]→ terminal commands removed.[/]")
except Exception as exc: # noqa: BLE001 - never abort the uninstall on this
@@ -454,6 +551,7 @@ def _remove_keys(keys: list[str]) -> int:
# already gone this path reads nothing on macOS and stays silent.
if cfg.delete_secret(key) or macos_gone:
deleted += 1
+ _remove_credential_bookkeeping()
if deleted:
_console.print(f" [ok]→ removed {deleted} saved key(s) from the keychain.[/]")
elif keys:
@@ -461,6 +559,24 @@ def _remove_keys(keys: list[str]) -> int:
return deleted
+def _remove_credential_bookkeeping() -> None:
+ """Remove the entries the app keeps beside the keys themselves.
+
+ The migration marker (``__migrated_from__<legacy>``) under the current
+ service, and on macOS the one vault item per service that holds every key
+ (deleting it also takes keys whose names could not be listed). Deleting
+ never reads a secret, so no Keychain dialog appears.
+ """
+ from dodaios.core.identity_migration import keyring_marker_key
+ from dodaios.core.keychain_bundle import VAULT_ACCOUNT
+
+ for legacy in cfg.LEGACY_KEYRING_SERVICES:
+ marker = keyring_marker_key(legacy)
+ _macos_delete_keychain_items(marker)
+ cfg.delete_secret(marker)
+ _macos_delete_keychain_items(VAULT_ACCOUNT)
+
+
def _running_inside(path: Path) -> bool:
"""True when the current interpreter lives inside ``path`` (self-hosted).
@@ -519,7 +635,11 @@ def _remove_folder(install_dir: Path) -> bool:
POSIX (and Windows when NOT self-hosted): direct ``rmtree``. Windows +
self-hosted: schedule a detached deleter and report that it will finish a
- moment after we exit."""
+ moment after we exit. A link is never followed: given one, only the link
+ goes."""
+ if is_directory_link(install_dir):
+ _remove_install_links((install_dir,))
+ return not os.path.lexists(install_dir)
if sys.platform == "win32" and _running_inside(install_dir):
try:
_spawn_windows_self_deleter(install_dir)
@@ -591,6 +711,8 @@ def run_uninstall(
if not keep_keys:
_remove_keys(plan.keyring_keys)
if not keep_folder:
+ # The links first: once the folder is gone they would dangle.
+ _remove_install_links(plan.install_links)
_remove_folder(plan.install_dir)
_console.print()
diff --git a/dodaios/setup/update_rollback.py b/dodaios/setup/update_rollback.py
new file mode 100644
index 0000000000..e2477b628c
--- /dev/null
+++ b/dodaios/setup/update_rollback.py
@@ -0,0 +1,140 @@
+"""Undo, before a failed update rolls back, what this release's installer moved.
+
+The updater of the release before this one runs this file when this release
+failed to install (``rollback_hook`` in ``install/update-contract.json``), as
+``<checkout python> dodaios/setup/update_rollback.py <previous> <target>``
+while this release is still checked out, and then returns the checkout to
+``<previous>`` and runs that revision's installer.
+
+This release's installer renames the macOS app bundle to its current name
+(``dodaios.setup.macos_app_bundle.rename_legacy_macos_app_bundles``). The
+revision the update falls back to may only know the bundle under an earlier
+name: its installer would not find the app, build a second one under that
+name and leave two apps in Launchpad. So the bundle gets back the name the
+previous revision's own update contract states, or the first earlier name when
+that revision predates the contract. The same rules as the forward rename
+apply: one ``os.rename``, only this install's bundle, never over another app.
+
+Never fails the rollback: every problem is logged and the exit code is 0.
+"""
+
+from __future__ import annotations
+
+import logging
+import os
+import subprocess
+import sys
+from collections.abc import Callable, Sequence
+from pathlib import Path
+
+_ROOT = Path(__file__).resolve().parents[2]
+if str(_ROOT) not in sys.path:
+ # Run as a file, not as a module: the checkout itself is not on the path.
+ sys.path.insert(0, str(_ROOT))
+
+from dodaios.core.branding import ( # noqa: E402 - bootstrap source path above
+ LEGACY_MACOS_APP_DIR_NAMES,
+ MACOS_APP_DIR_NAME,
+ MACOS_BUNDLE_ID,
+)
+from dodaios.core.update_contract import ( # noqa: E402 - bootstrap source path above
+ CONTRACT_PATH,
+ parse_update_contract,
+)
+
+log = logging.getLogger(__name__)
+
+GitShow = Callable[[Path, str], str | None]
+
+
+def _git_show(root: Path, spec: str) -> str | None:
+ """``git show <spec>`` in ``root``; ``None`` when git has no such file."""
+ try:
+ result = subprocess.run(
+ ["git", "show", spec],
+ cwd=str(root),
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ timeout=30,
+ check=False,
+ )
+ except (OSError, subprocess.SubprocessError) as exc:
+ log.warning("Could not run git show %s in %s: %s", spec, root, exc)
+ return None
+ return result.stdout if result.returncode == 0 else None
+
+
+def previous_macos_app_dir_name(
+ root: Path, previous: str, *, git_show: GitShow = _git_show
+) -> str:
+ """The bundle name the revision ``previous`` looks for.
+
+ A revision without a contract predates every rename and uses the first
+ earlier name. A contract this version cannot read leaves the bundle as it
+ is: the current name is the answer that renames nothing.
+ """
+ document = git_show(root, f"{previous}:{CONTRACT_PATH}")
+ if document is None:
+ return LEGACY_MACOS_APP_DIR_NAMES[0]
+ return parse_update_contract(document).macos_app_dir_name
+
+
+def restore_macos_app_bundle_name(name: str, roots: Sequence[Path]) -> list[Path]:
+ """Rename this install's bundle from the current name back to ``name``.
+
+ Only to an earlier name of ours, only a bundle whose ``Info.plist`` names
+ the managed bundle id, never over anything that already has that name.
+ Returns the bundles now under ``name``.
+ """
+ if name == MACOS_APP_DIR_NAME or name not in LEGACY_MACOS_APP_DIR_NAMES:
+ return []
+ from dodaios.setup.macos_app_bundle import _bundle_identifier
+
+ restored: list[Path] = []
+ for root in roots:
+ source = root / MACOS_APP_DIR_NAME
+ target = root / name
+ try:
+ if source.is_symlink() or not source.is_dir():
+ continue
+ if _bundle_identifier(source) != MACOS_BUNDLE_ID:
+ continue
+ if target.exists() or target.is_symlink():
+ log.warning("Keeping %s: %s already exists.", source, target)
+ continue
+ os.rename(source, target)
+ except OSError as exc:
+ log.warning("Could not rename %s back to %s: %s", source, target, exc)
+ continue
+ log.info("Renamed the macOS app %s back to %s for the rollback.", source, target)
+ restored.append(target)
+ return restored
+
+
+def main(argv: Sequence[str] | None = None) -> int:
+ args = list(sys.argv[1:] if argv is None else argv)
+ if sys.platform != "darwin" or not args:
+ return 0
+ logging.basicConfig(level=logging.INFO, format="update rollback: %(message)s")
+ try:
+ from dodaios.autostart.macos import retarget_launch_agent
+ from dodaios.setup.macos_app_bundle import (
+ SYSTEM_APPLICATIONS_DIR,
+ user_applications_dir,
+ )
+
+ name = previous_macos_app_dir_name(_ROOT, args[0])
+ roots = (SYSTEM_APPLICATIONS_DIR, user_applications_dir())
+ for bundle in restore_macos_app_bundle_name(name, roots):
+ # The login item names the bundle by path; the previous revision
+ # only follows a path under its own name.
+ retarget_launch_agent(bundle)
+ except Exception: # noqa: BLE001 - the rollback itself must go on
+ log.exception("Could not restore the macOS app's earlier name")
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/dodaios/ui/icon_utils.py b/dodaios/ui/icon_utils.py
index 37ee757048..3800c3faf1 100644
--- a/dodaios/ui/icon_utils.py
+++ b/dodaios/ui/icon_utils.py
@@ -30,14 +30,27 @@ from dodaios.core.instance import current_instance
# window and never overwrite each other's Start-Menu entry. Bound at import —
# the launcher pins the instance into the environment before importing this.
_INSTANCE = current_instance()
-# The name REGISTERED with the shell (toast identity, shortcut description,
-# relaunch name, desktop-entry ``Name``). It is the persistent name, not the
-# window title: a registration keeps the value existing installs carry.
-APP_DISPLAY_NAME = _INSTANCE.persistent_name
+# The name REGISTERED with the Linux shell (desktop-entry ``Name``). It moves
+# together with the entry's file name and the window class below.
+APP_DISPLAY_NAME = _INSTANCE.linux_app_name
+# The name registered with the Windows shell: toast identity, shortcut
+# description, relaunch name. It matches the shortcut's file name, which is the
+# name the taskbar and Windows Search show.
+WINDOWS_APP_DISPLAY_NAME = _INSTANCE.windows_launcher_entry_name
APP_USER_MODEL_ID = _INSTANCE.windows_aumid
BRANDED_LAUNCHER_EXE_NAME = _INSTANCE.windows_branded_launcher_file_name
+#: Earlier names of the branded exe. Never created again, but a copy under
+#: one of them is still this app (a pinned taskbar button or a shortcut of an
+#: earlier release starts it), so it never re-execs into the current name.
+LEGACY_BRANDED_LAUNCHER_EXE_NAMES = _INSTANCE.legacy_windows_branded_launcher_file_names
START_MENU_SHORTCUT_NAME = _INSTANCE.windows_shortcut_file_name
+#: Earlier names of the Start-Menu and Desktop shortcut, retired once the
+#: current one is in place (``dodaios.setup.desktop_integration``).
+LEGACY_START_MENU_SHORTCUT_NAMES = _INSTANCE.legacy_windows_shortcut_file_names
LINUX_DESKTOP_ENTRY_NAME = _INSTANCE.linux_desktop_entry_file_name
+#: Earlier names of the applications-menu entry, retired once the current one
+#: is in place, and only where they start this install.
+LEGACY_LINUX_DESKTOP_ENTRY_NAMES = _INSTANCE.legacy_linux_desktop_entry_file_names
LINUX_WM_CLASS = _INSTANCE.linux_wm_class
#: Launcher argv written into shortcuts / desktop entries so a click reopens
#: THIS instance (``--instance dev`` for the dev app, nothing for the default).
@@ -100,7 +113,7 @@ def _installer_owns_shell_registration(artifact: str) -> bool:
return True
# A per-install copy of ``pythonw.exe`` (next to the interpreter, or in the
-# per-user ``%LOCALAPPDATA%\PersonalJarvis\bin`` when the base dir is read-only),
+# per-user ``%LOCALAPPDATA%\DodaiosApp\bin`` when the base dir is read-only),
# carrying the Jarvis mascot as its EMBEDDED icon. On Windows the taskbar button of
# a running app takes the icon of the LAUNCHING EXECUTABLE — not the window icon,
# class icon, AUMID, Start-Menu shortcut, registry, or icon cache (all verified
@@ -116,7 +129,7 @@ _BRANDED_LAUNCH_ENV = WINDOWS_BRANDED_LAUNCH_ENV_VAR
def register_windows_app_user_model_id(
app_id: str = APP_USER_MODEL_ID,
*,
- display_name: str = APP_DISPLAY_NAME,
+ display_name: str = WINDOWS_APP_DISPLAY_NAME,
icon_path: Path | None = None,
) -> bool:
"""Register the AUMID's ``DisplayName`` (+ icon) under HKCU for *toasts*.
@@ -185,7 +198,7 @@ def _shortcut_launch_target() -> Path | None:
report from 2026-08-16, next to an Obsidian and a Discord entry that work
because each points at its own ``.exe``.
- ``PersonalJarvis.exe`` built inside the venv IS our own executable and needs
+ ``DodaiosApp.exe`` built inside the venv IS our own executable and needs
no environment handed to it, so it is a valid shortcut target and makes the
entry a real app. The other branded homes need ``__PYVENV_LAUNCHER__``,
which a shortcut cannot supply — those keep the historical ``pythonw``
@@ -411,7 +424,7 @@ def _base_pythonw_executable() -> Path | None:
def _user_launcher_dir() -> Path | None:
"""Per-user home for the branded exe when the base dir is not writable.
- ``%LOCALAPPDATA%\\PersonalJarvis\\bin`` is writable for every account — the
+ ``%LOCALAPPDATA%\\DodaiosApp\\bin`` is writable for every account — the
base interpreter dir is NOT on most machines (an all-users install lands in
``Program Files``; only an elevated/admin session can write there, which is
why base-dir-only branding worked on the maintainer's box and silently kept
@@ -550,7 +563,7 @@ def ensure_branded_launcher_exe() -> Path | None:
The taskbar button takes its icon from the window-owning executable, which is
the *base* interpreter (the venv ``pythonw`` only redirects to it). So we copy
- the base ``pythonw.exe`` to ``PersonalJarvis.exe`` and stamp the Jarvis
+ the base ``pythonw.exe`` to ``DodaiosApp.exe`` and stamp the Jarvis
``.ico`` as its embedded icon. The venv is re-attached at launch via
``__PYVENV_LAUNCHER__`` (see ``maybe_reexec_through_branded_launcher``), so
the branded copy runs the app with the venv's packages while OWNING the
@@ -561,7 +574,7 @@ def ensure_branded_launcher_exe() -> Path | None:
1. next to the base interpreter — zero extra files, but the base dir is
writable only for elevated accounts when Python lives under
``Program Files`` (the common all-users install);
- 2. ``%LOCALAPPDATA%\\PersonalJarvis\\bin`` — writable for EVERY account;
+ 2. ``%LOCALAPPDATA%\\DodaiosApp\\bin`` — writable for EVERY account;
the interpreter runtime DLLs are copied beside the exe and the fresh
copy is smoke-started once before it is trusted.
@@ -659,7 +672,7 @@ def maybe_reexec_through_branded_launcher(argv: list[str]) -> int | None:
The taskbar button icon is the launching exe's embedded icon, so a bare
``pythonw.exe`` start shows the Python logo regardless of every window-icon /
AUMID / shortcut effort. Relaunching the SAME launcher module through
- ``PersonalJarvis.exe`` (a pythonw copy carrying the mascot icon) is the only
+ ``DodaiosApp.exe`` (a pythonw copy carrying the mascot icon) is the only
thing that brands the taskbar button — and it covers every entry point at one
chokepoint (``run.bat``, the Start-Menu/pinned shortcut, the autostart task,
the tray self-restart), because they all funnel through ``main()``.
@@ -676,9 +689,14 @@ def maybe_reexec_through_branded_launcher(argv: list[str]) -> int | None:
# real running image is ``sys._base_executable`` (our branded copy).
if os.environ.get(_BRANDED_LAUNCH_ENV) == "1":
return None
- branded_name = BRANDED_LAUNCHER_EXE_NAME.lower()
+ # Every name the branded exe has had: a copy under an earlier name (a
+ # pinned taskbar button or a shortcut of an earlier release starts it) is
+ # the branded app already, not a bare interpreter to brand.
+ branded_names = {
+ name.lower() for name in (BRANDED_LAUNCHER_EXE_NAME, *LEGACY_BRANDED_LAUNCHER_EXE_NAMES)
+ }
base_exe = getattr(sys, "_base_executable", "") or ""
- if Path(base_exe).name.lower() == branded_name:
+ if Path(base_exe).name.lower() in branded_names:
return None
# The in-venv branded copy IS the running image, yet `_base_executable`
# still names the interpreter behind it (a Store alias, say) — so the check
@@ -686,7 +704,7 @@ def maybe_reexec_through_branded_launcher(argv: list[str]) -> int | None:
# just started it. Harmless (the child sets the env marker and stops) but a
# wasted process and boot delay on every Start-Menu launch, which is the
# normal way in once the shortcut targets this exe.
- if Path(sys.executable).name.lower() == branded_name:
+ if Path(sys.executable).name.lower() in branded_names:
return None
# A visible-console/debug run wants python.exe's console; re-exec'ing through
# a windowless pythonw copy would swallow it. Leave those alone.
@@ -813,7 +831,7 @@ def _shortcut_matches_install(
def ensure_start_menu_shortcut(
*,
aumid: str = APP_USER_MODEL_ID,
- display_name: str = APP_DISPLAY_NAME,
+ display_name: str = WINDOWS_APP_DISPLAY_NAME,
icon_path: Path | None = None,
programs_dir: Path | None = None,
) -> bool:
@@ -823,7 +841,7 @@ def ensure_start_menu_shortcut(
a grouped taskbar button and its jump-list header: it matches the running
window's process AUMID (set by ``SetCurrentProcessExplicitAppUserModelID``)
to a Start-Menu shortcut carrying the same ``System.AppUserModel.ID`` and
- shows that shortcut's **file name** ("Personal Jarvis") and **icon**. A
+ shows that shortcut's **file name** ("Dodaios") and **icon**. A
shortcut-less ``pythonw`` app falls back to the process description
("Python") — the exact symptom the user reported. The shortcut only needs to
*exist* in the Start Menu; Windows resolves it regardless of how the app was
@@ -918,10 +936,29 @@ def ensure_start_menu_shortcut(
if _write_branded_shortcut(lnk, target=pythonw, ico=ico, aumid=aumid,
display_name=display_name):
logger.debug("Start-Menu shortcut ensured: {}", lnk)
+ _retire_legacy_start_menu_shortcuts(programs, launch_target=pythonw)
return True
return False
+def _retire_legacy_start_menu_shortcuts(programs: Path, *, launch_target: Path) -> None:
+ """Drop a Start-Menu entry of the product's earlier name that starts this install.
+
+ Runs once the current entry exists, so the app is never left without one.
+ Best-effort: a failure leaves a second, working entry behind.
+ """
+ try:
+ import dodaios
+ from dodaios.setup.desktop_integration import retire_legacy_windows_launchers
+
+ install_root = Path(dodaios.__file__).resolve().parent.parent
+ retire_legacy_windows_launchers(
+ (programs,), install_root=install_root, launch_target=launch_target
+ )
+ except Exception as exc: # noqa: BLE001 — cosmetic cleanup, never load-bearing
+ logger.debug("earlier Start-Menu shortcut not retired: {}", exc)
+
+
def _write_branded_shortcut(
lnk: Path, *, target: Path, ico: Path, aumid: str, display_name: str
) -> bool:
@@ -978,7 +1015,7 @@ def _default_desktop_dir() -> Path | None:
def ensure_desktop_shortcut(
*,
aumid: str = APP_USER_MODEL_ID,
- display_name: str = APP_DISPLAY_NAME,
+ display_name: str = WINDOWS_APP_DISPLAY_NAME,
icon_path: Path | None = None,
desktop_dir: Path | None = None,
create_if_missing: bool = True,
@@ -1091,7 +1128,7 @@ def ensure_windows_app_identity(
"Python".
2. ``ensure_start_menu_shortcut`` — the AUMID-tagged Start-Menu shortcut
that gives that key a *name* + icon, so the button/jump-list header
- read "Personal Jarvis" instead of the ``pythonw.exe`` description. This
+ read "Dodaios" instead of the ``pythonw.exe`` description. This
is the layer that actually fixed the "taskbar says Python" report;
layer 1 alone leaves the button nameless.
3. ``register_windows_app_user_model_id`` — HKCU ``DisplayName`` for the
@@ -1146,7 +1183,7 @@ def set_window_relaunch_properties(
*,
ico_path: Path | None = None,
aumid: str = APP_USER_MODEL_ID,
- display_name: str = APP_DISPLAY_NAME,
+ display_name: str = WINDOWS_APP_DISPLAY_NAME,
) -> bool:
"""Stamp per-window AppUserModel Relaunch* properties → taskbar shows OUR icon.
@@ -1576,10 +1613,23 @@ def _refresh_linux_desktop_database(applications_dir: Path) -> bool:
return False
+def _retire_legacy_linux_desktop_entries(applications_dir: Path, install_dir: Path) -> None:
+ """Remove the earlier-named menu entries that start this install. Never raises."""
+ try:
+ from dodaios.autostart.linux import remove_entries_of_install
+
+ remove_entries_of_install(
+ [applications_dir / name for name in LEGACY_LINUX_DESKTOP_ENTRY_NAMES],
+ str(install_dir),
+ )
+ except Exception as exc: # noqa: BLE001 — a leftover entry is cosmetic, never load-bearing
+ logger.debug("earlier Linux menu entries not retired: {}", exc)
+
+
def ensure_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
"""Install/refresh the applications-menu ``.desktop`` entry (Linux only).
- This is what makes (a) "Personal Jarvis" findable in the desktop's app
+ This is what makes (a) "Dodaios" findable in the desktop's app
search/menu and (b) the dock/taskbar show the Jarvis icon for the RUNNING
window: ``pin_linux_wm_class`` pins the window's WM_CLASS, and this entry's
``StartupWMClass`` is the other half of that handshake. Without it the dock
@@ -1590,6 +1640,11 @@ def ensure_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
content changed), best-effort — never raises, never blocks the window.
``applications_dir`` is a test seam; without it, non-Linux is a no-op.
+ An entry an earlier release wrote under the earlier file name
+ (``personal-jarvis.desktop``) is removed once the current one is in place,
+ but only when it starts this install: left behind, the menu would list the
+ app twice, and its ``StartupWMClass`` no longer matches the window.
+
A frozen build writes nothing. Inside an AppImage ``sys.executable`` points
into a temporary mount that is gone the moment the app exits, so the entry
would launch nothing at all; the AppImage's own ``.desktop`` (built by
@@ -1629,10 +1684,10 @@ def ensure_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
f"StartupWMClass={escape_value(LINUX_WM_CLASS)}\n"
"Categories=Utility;\n"
# The app search matches Name, and only some shells also match
- # Comment — the product name is two words, so a user typing the
- # half they remember ("jarvis", or what the assistant is FOR) needs
- # these to be hit at all. Same role as the Windows Start-Menu file
- # name being the searchable token.
+ # Comment. A user typing the name they remember from earlier
+ # releases ("jarvis"), or what the assistant is FOR, needs these
+ # to be hit at all. Same role as the Windows Start-Menu file name
+ # being the searchable token.
"Keywords=jarvis;assistant;voice;agent;automation;\n"
)
entry = applications_dir / LINUX_DESKTOP_ENTRY_NAME
@@ -1642,6 +1697,7 @@ def ensure_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
# the entry — an interrupted earlier run could have written the
# file and never registered it. Re-announcing is cheap and
# idempotent, so a repaired install never needs a re-login.
+ _retire_legacy_linux_desktop_entries(applications_dir, PROJECT_ROOT)
_refresh_linux_desktop_database(applications_dir)
return True
except OSError:
@@ -1659,6 +1715,7 @@ def ensure_linux_desktop_entry(applications_dir: Path | None = None) -> bool:
entry.chmod(0o755)
except OSError as exc:
logger.debug("could not mark {} executable: {}", entry, exc)
+ _retire_legacy_linux_desktop_entries(applications_dir, PROJECT_ROOT)
_refresh_linux_desktop_database(applications_dir)
logger.debug("Linux applications .desktop entry written: {}", entry)
return True
diff --git a/dodaios/ui/relauncher.py b/dodaios/ui/relauncher.py
index 8ce5c9de27..e907c2c2f2 100644
--- a/dodaios/ui/relauncher.py
+++ b/dodaios/ui/relauncher.py
@@ -1,7 +1,7 @@
"""Detached helper that restarts the Jarvis desktop app cleanly.
The desktop app cannot restart itself in-process: its single-instance Named
-Mutex (``Global\\PersonalJarvis_v1``) is held until the process exits, and a
+Mutex (``Global\\Dodaios_v1``) is held until the process exits, and a
fresh launcher started while the old process still lives would just activate the
old window and exit (see ``dodaios/ui/shell/single_instance.py``). So a restart is
two-phase:
@@ -32,8 +32,10 @@ from pathlib import Path
from dodaios.core.branding import (
LAUNCHER_ENTRY_NAME,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES,
MACOS_APP_DIR_NAME,
MANAGED_INSTALL_MARKER,
+ MANAGED_INSTALL_MARKERS,
PRODUCT_NAME,
WINDOWS_BRANDED_LAUNCH_ENV_VAR,
WINDOWS_BRANDED_LAUNCHER_DIR_NAME,
@@ -47,6 +49,8 @@ from dodaios.core.update_contract import (
LAUNCHER_MODULE = DEFAULT_CONTRACT.launcher_module
MANAGED_MARKER = MANAGED_INSTALL_MARKER
+# Every name the installer's marker has had; any one of them marks the checkout.
+MANAGED_MARKERS = MANAGED_INSTALL_MARKERS
PENDING_UPDATE_FILENAME = ".jarvis-update-pending.json"
UPDATE_RESULT_FILENAME = ".jarvis-update-result.json"
_REVISION_RE = re.compile(r"^[0-9a-fA-F]{7,64}$")
@@ -109,7 +113,7 @@ def _frozen() -> bool:
def _enclosing_macos_app(executable: str) -> Path | None:
- """``/Applications/Personal Jarvis.app`` for an executable inside it."""
+ """The ``.app`` bundle an executable sits in, whatever it is called."""
for parent in Path(executable).resolve().parents:
if parent.suffix == ".app":
return parent
@@ -458,20 +462,22 @@ def _existing_branded_launcher() -> Path | None:
"""Return an already-built branded launcher exe, or ``None``.
Cheap existence check only — never copies, never smoke-starts. The Start
- Menu path owns creating the file; a restart just needs to find it.
+ Menu path owns creating the file; a restart just needs to find it. The
+ current name wins; a copy under an earlier name (built by an earlier
+ release, in its earlier per-user folder) is still the branded app.
"""
if sys.platform != "win32":
return None
- from dodaios.core.instance import current_instance
-
- name = current_instance().windows_branded_launcher_file_name
- candidates: list[Path] = [Path(sys.executable).with_name(name)]
base = getattr(sys, "_base_executable", "") or ""
- if base:
- candidates.append(Path(base).with_name(name))
local = os.environ.get("LOCALAPPDATA")
- if local:
- candidates.append(Path(local) / WINDOWS_BRANDED_LAUNCHER_DIR_NAME / "bin" / name)
+ folders = (WINDOWS_BRANDED_LAUNCHER_DIR_NAME, *LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES)
+ candidates: list[Path] = []
+ for name in _branded_launcher_names():
+ candidates.append(Path(sys.executable).with_name(name))
+ if base:
+ candidates.append(Path(base).with_name(name))
+ if local:
+ candidates.extend(Path(local) / folder / "bin" / name for folder in folders)
seen: set[str] = set()
for cand in candidates:
key = str(cand).casefold()
@@ -486,6 +492,17 @@ def _existing_branded_launcher() -> Path | None:
return None
+def _branded_launcher_names() -> tuple[str, ...]:
+ """The branded exe's file names for this instance, the current one first."""
+ from dodaios.core.instance import current_instance
+
+ instance = current_instance()
+ return (
+ instance.windows_branded_launcher_file_name,
+ *instance.legacy_windows_branded_launcher_file_names,
+ )
+
+
def _apply_branded_launch_env(env: dict[str, str], argv: list[str]) -> dict[str, str]:
"""Mark a branded-exe spawn so the child does not re-exec itself.
@@ -495,10 +512,8 @@ def _apply_branded_launch_env(env: dict[str, str], argv: list[str]) -> dict[str,
"""
if sys.platform != "win32" or not argv:
return env
- from dodaios.core.instance import current_instance
-
- branded_name = current_instance().windows_branded_launcher_file_name.casefold()
- if Path(argv[0]).name.casefold() != branded_name:
+ branded_names = {name.casefold() for name in _branded_launcher_names()}
+ if Path(argv[0]).name.casefold() not in branded_names:
return env
env = dict(env)
env[WINDOWS_BRANDED_LAUNCH_ENV_VAR] = "1"
@@ -544,15 +559,18 @@ def _restart_admin_port(cwd: str | Path | None = None) -> int:
root = Path(cwd) if cwd else None
if root is not None:
# Asked of the tree on disk at probe time: after an update the config
- # file carries whatever name the installed release gave it.
- cfg = root / read_update_contract(root).config_file
+ # file carries whatever name the installed release gave it, and the
+ # first of its names that exists is the configuration.
+ names = read_update_contract(root).config_files
+ cfg = next((root / name for name in names if (root / name).is_file()), None)
try:
import tomllib
- data = tomllib.loads(cfg.read_text(encoding="utf-8"))
- port = data.get("ui", {}).get("admin_api_port")
- if isinstance(port, int) and 1 <= port <= 65535:
- base = port
+ if cfg is not None:
+ data = tomllib.loads(cfg.read_text(encoding="utf-8"))
+ port = data.get("ui", {}).get("admin_api_port")
+ if isinstance(port, int) and 1 <= port <= 65535:
+ base = port
except (OSError, UnicodeDecodeError, ValueError, TypeError, AttributeError):
pass # unreadable config file → packaged default port
return current_instance().port(base)
@@ -569,7 +587,7 @@ def _desktop_is_serving(
"""True when something is already accepting on this instance's admin port.
Used to recognise a successful Windows branded hand-off: the python
- launcher PID dies on purpose after spawning ``PersonalJarvis.exe``, and
+ launcher PID dies on purpose after spawning ``DodaiosApp.exe``, and
the new window process is a different PID. A listening port is the
honest "the app came back" signal.
"""
@@ -708,7 +726,7 @@ def _new_instance_settled(
(macOS bundle, Linux, a python that did not re-exec).
* The desktop admin port starts accepting — the Windows branded hand-off.
``python -m launcher`` (and even a branded spawn that still re-execs)
- exits within a second after starting ``PersonalJarvis.exe``. Treating
+ exits within a second after starting ``DodaiosApp.exe``. Treating
that exit as a bounce used to spawn two more copies that raced the
first, and sometimes none of them kept the window (BUG-181).
@@ -903,7 +921,8 @@ def _run_rollback_hook(root: Path, hook: str, *, previous: str, target: str) ->
#: deliberately excluded: git never touches untracked files, and a full copy
#: of a multi-hundred-MB data dir per update is not "best-effort" territory.
_STATE_SNAPSHOT_ITEMS = (
- "jarvis.toml",
+ # Every name the config file may have; whichever exists is saved.
+ *DEFAULT_CONTRACT.config_files,
".env",
Path("data") / "credentials.json",
Path("wiki") / "obsidian-vault",
@@ -972,7 +991,8 @@ def finalize_pending_update(cwd: str | Path) -> bool:
payload = _read_pending_update(root)
if payload is None:
return True
- if not (root / MANAGED_MARKER).is_file() or not (root / ".git").exists():
+ managed = any((root / name).is_file() for name in MANAGED_MARKERS)
+ if not managed or not (root / ".git").exists():
pending_path.unlink(missing_ok=True)
return False
diff --git a/dodaios/ui/shell/single_instance.py b/dodaios/ui/shell/single_instance.py
index fd0e42c8fe..c7e1408b9b 100644
--- a/dodaios/ui/shell/single_instance.py
+++ b/dodaios/ui/shell/single_instance.py
@@ -3,10 +3,13 @@
**Two-layer strategy:**
1. **Atomic primary claim with kernel-guaranteed crash cleanup:**
- a named mutex via pywin32 on Windows, an exclusive non-blocking
+ named mutexes via pywin32 on Windows, an exclusive non-blocking
``flock`` on ``instance.lock`` on POSIX. In both cases the OS releases
the claim when the process dies (handle close / fd close), so there are
- no stale locks to garbage-collect.
+ no stale locks to garbage-collect. On Windows the primary holds the
+ mutex under its current name AND under every name an earlier release
+ used: a process that finds any of them taken is a secondary, so an old
+ and a new release never run side by side (``dodaios.core.branding``).
2. **Session file** (``<user-app-dir>/session.json``) — stores the port +
token of the running primary instance, so a secondary can ping it on
@@ -15,7 +18,7 @@
Flow when a secondary starts:
-1. Mutex claim fails → a primary already exists.
+1. A mutex claim fails (any name) → a primary already exists.
2. Read the session file → port+token → HTTP POST.
3. The primary brings its window to the front, the secondary exits.
4. If the session file is missing / the HTTP call fails → the primary is a
@@ -36,9 +39,13 @@ import httpx
from dodaios.core.instance import current_instance
from dodaios.core.paths import ensure_user_dirs
-# Per instance (``dodaios.core.instance``): the dev app claims its own mutex so
-# it never reads the live app as "already running".
+# Per instance (``dodaios.core.instance``): the dev app claims its own mutexes
+# so it never reads the live app as "already running".
MUTEX_NAME = current_instance().windows_mutex_name
+#: The names an earlier release's primary of this instance holds. Claimed too.
+LEGACY_MUTEX_NAMES = current_instance().legacy_windows_mutex_names
+#: Every name a primary claims, the current one first.
+MUTEX_NAMES = (MUTEX_NAME, *LEGACY_MUTEX_NAMES)
logger = logging.getLogger(__name__)
@@ -61,22 +68,23 @@ def _app_data_dir() -> Path:
@dataclass(slots=True)
class InstanceClaim:
"""Handle to the active claim — call `release()` on shutdown."""
- _mutex: Any = None
+ _mutexes: tuple[Any, ...] = ()
_lock_fd: int | None = None
_session_file: Path | None = None
def release(self) -> None:
- # Release the Windows mutex
- if self._mutex is not None:
+ # Release the Windows mutexes, every name the claim holds
+ for mutex in self._mutexes:
try:
import win32api # type: ignore[import-not-found]
import win32event # type: ignore[import-not-found]
- win32event.ReleaseMutex(self._mutex)
- win32api.CloseHandle(self._mutex)
- except Exception: # noqa: BLE001
- pass
- self._mutex = None
+ win32event.ReleaseMutex(mutex)
+ win32api.CloseHandle(mutex)
+ except Exception as exc: # noqa: BLE001
+ # The kernel still releases the mutex when this process exits.
+ logger.debug("Could not release a mutex: %s", exc)
+ self._mutexes = ()
# Release the POSIX flock (closing the fd drops the kernel lock)
if self._lock_fd is not None:
try:
@@ -121,7 +129,7 @@ class SingleInstance:
"""Primary claim — returns an `InstanceClaim`, or None if another
process is already active.
"""
- if os.name != "nt":
+ if not _is_windows():
return self._try_claim_posix()
try:
import win32event # type: ignore[import-not-found]
@@ -130,21 +138,19 @@ class SingleInstance:
# Windows without pywin32 — no mutex available, report as primary
# (the load-bearing launcher lock still enforces exclusivity).
self._on_primary_claim()
- return InstanceClaim(_mutex=None, _session_file=self.session_file)
-
- mutex = win32event.CreateMutex(None, False, MUTEX_NAME)
- last_error = _get_last_error()
- if last_error == winerror.ERROR_ALREADY_EXISTS:
- # Already active — close the handle right away.
- try:
- import win32api
+ return InstanceClaim(_session_file=self.session_file)
- win32api.CloseHandle(mutex)
- except Exception: # noqa: BLE001
- pass
- return None
+ handles: list[Any] = []
+ for name in MUTEX_NAMES:
+ handles.append(win32event.CreateMutex(None, False, name))
+ if _get_last_error() == winerror.ERROR_ALREADY_EXISTS:
+ # A primary of this or an earlier release is active. Drop
+ # every handle taken so far, so the names this process did
+ # create vanish with it and never block the next start.
+ _close_handles(handles)
+ return None
self._on_primary_claim()
- return InstanceClaim(_mutex=mutex, _session_file=self.session_file)
+ return InstanceClaim(_mutexes=tuple(handles), _session_file=self.session_file)
def _try_claim_posix(self) -> InstanceClaim | None:
"""POSIX primary claim via an exclusive non-blocking ``flock``.
@@ -225,6 +231,23 @@ class SingleInstance:
return False
+def _is_windows() -> bool:
+ return os.name == "nt"
+
+
+def _close_handles(handles: list[Any]) -> None:
+ try:
+ import win32api # type: ignore[import-not-found]
+ except ImportError:
+ return # without pywin32 no mutex handle was ever created
+ for handle in handles:
+ try:
+ win32api.CloseHandle(handle)
+ except Exception as exc: # noqa: BLE001
+ # The kernel still closes the handle when this process exits.
+ logger.debug("Could not close a mutex handle: %s", exc)
+
+
def _get_last_error() -> int:
try:
import ctypes
diff --git a/dodaios/ui/web/dist/assets/antigravity-8EbLmxw8.svg b/dodaios/ui/web/dist/assets/antigravity-_lOIeRhP.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/antigravity-8EbLmxw8.svg
rename to dodaios/ui/web/dist/assets/antigravity-_lOIeRhP.svg
diff --git a/dodaios/ui/web/dist/assets/fly-BBgZ4Q4B.svg b/dodaios/ui/web/dist/assets/fly-C4H8YhO_.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/fly-BBgZ4Q4B.svg
rename to dodaios/ui/web/dist/assets/fly-C4H8YhO_.svg
diff --git a/dodaios/ui/web/dist/assets/granola-CIlE1D1h.svg b/dodaios/ui/web/dist/assets/granola-CYNYNSF5.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/granola-CIlE1D1h.svg
rename to dodaios/ui/web/dist/assets/granola-CYNYNSF5.svg
diff --git a/dodaios/ui/web/dist/assets/intercom-Dh0L0ym2.svg b/dodaios/ui/web/dist/assets/intercom-DfEJASO4.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/intercom-Dh0L0ym2.svg
rename to dodaios/ui/web/dist/assets/intercom-DfEJASO4.svg
diff --git a/dodaios/ui/web/dist/assets/kubernetes-DGGHM7xL.svg b/dodaios/ui/web/dist/assets/kubernetes-BTaq8_2V.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/kubernetes-DGGHM7xL.svg
rename to dodaios/ui/web/dist/assets/kubernetes-BTaq8_2V.svg
diff --git a/dodaios/ui/web/dist/assets/neon-DXVqyv8y.svg b/dodaios/ui/web/dist/assets/neon-Buxn172S.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/neon-DXVqyv8y.svg
rename to dodaios/ui/web/dist/assets/neon-Buxn172S.svg
diff --git a/dodaios/ui/web/dist/assets/obsidian-BnPNDMFS.svg b/dodaios/ui/web/dist/assets/obsidian-DoGKp-BR.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/obsidian-BnPNDMFS.svg
rename to dodaios/ui/web/dist/assets/obsidian-DoGKp-BR.svg
diff --git a/dodaios/ui/web/dist/assets/onedrive-C_SGaMdu.svg b/dodaios/ui/web/dist/assets/onedrive-C6cVDewa.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/onedrive-C_SGaMdu.svg
rename to dodaios/ui/web/dist/assets/onedrive-C6cVDewa.svg
diff --git a/dodaios/ui/web/dist/assets/outlook-C7JHAwlw.svg b/dodaios/ui/web/dist/assets/outlook-B-qerR2g.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/outlook-C7JHAwlw.svg
rename to dodaios/ui/web/dist/assets/outlook-B-qerR2g.svg
diff --git a/dodaios/ui/web/dist/assets/postgresql-D-vtYnT7.svg b/dodaios/ui/web/dist/assets/postgresql-CrKK9N4f.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/postgresql-D-vtYnT7.svg
rename to dodaios/ui/web/dist/assets/postgresql-CrKK9N4f.svg
diff --git a/dodaios/ui/web/dist/assets/salesforce-B5hPJLMG.svg b/dodaios/ui/web/dist/assets/salesforce-DqKqehgY.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/salesforce-B5hPJLMG.svg
rename to dodaios/ui/web/dist/assets/salesforce-DqKqehgY.svg
diff --git a/dodaios/ui/web/dist/assets/teams-DisLtML7.svg b/dodaios/ui/web/dist/assets/teams-DlMZ5N6j.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/teams-DisLtML7.svg
rename to dodaios/ui/web/dist/assets/teams-DlMZ5N6j.svg
diff --git a/dodaios/ui/web/dist/assets/vscode-zVAWFD4C.svg b/dodaios/ui/web/dist/assets/vscode-BC_h-9TH.svg
similarity index 100%
rename from dodaios/ui/web/dist/assets/vscode-zVAWFD4C.svg
rename to dodaios/ui/web/dist/assets/vscode-BC_h-9TH.svg
diff --git a/dodaios/ui/web/dist/assets/xai-DOoawZUy.js b/dodaios/ui/web/dist/assets/xai-CKxq66Rb.js
similarity index 99%
rename from dodaios/ui/web/dist/assets/xai-DOoawZUy.js
rename to dodaios/ui/web/dist/assets/xai-CKxq66Rb.js
index 91a9c992fc..67e16a1322 100644
--- a/dodaios/ui/web/dist/assets/xai-DOoawZUy.js
+++ b/dodaios/ui/web/dist/assets/xai-CKxq66Rb.js
@@ -1 +1 @@
-const e="/assets/antigravity-8EbLmxw8.svg",a="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.763%2010.036c0%20.296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183%200%20.08-.048.16-.152.24l-.503.335a.383.383%200%200%201-.208.072c-.08%200-.16-.04-.239-.112a2.47%202.47%200%200%201-.287-.375%206.18%206.18%200%200%201-.248-.471c-.622.734-1.405%201.101-2.347%201.101-.67%200-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533%200-.678.239-1.23.726-1.644.487-.415%201.133-.623%201.955-.623.272%200%20.551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28%200-.568.031-.863.103-.295.072-.583.16-.862.272a2.287%202.287%200%200%201-.28.104.488.488%200%200%201-.127.023c-.112%200-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597%200%200%201%20.224-.167c.279-.144.614-.264%201.005-.36a4.84%204.84%200%200%201%201.246-.151c.95%200%201.644.216%202.091.647.439.43.662%201.085.662%201.963v2.586zm-3.24%201.214c.263%200%20.534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66%206.66%200%200%200-.735-.136%206.02%206.02%200%200%200-.75-.048c-.535%200-.926.104-1.19.32-.263.215-.39.518-.39.917%200%20.375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144%200-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586%205.55a1.398%201.398%200%200%201-.072-.32c0-.128.064-.2.191-.2h.783c.151%200%20.255.025.31.08.065.048.113.16.16.312l1.342%205.284%201.245-5.284c.04-.16.088-.264.151-.312a.549.549%200%200%201%20.32-.08h.638c.152%200%20.256.025.32.08.063.048.12.16.151.312l1.261%205.348%201.381-5.348c.048-.16.104-.264.16-.312a.52.52%200%200%201%20.311-.08h.743c.127%200%20.2.065.2.2%200%20.04-.009.08-.017.128a1.137%201.137%200%200%201-.056.2l-1.923%206.17c-.048.16-.104.263-.168.311a.51.51%200%200%201-.303.08h-.687c-.151%200-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23%205.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415%200-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563%200%200%201-.048-.224v-.407c0-.167.064-.247.183-.247.048%200%20.096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502%200%20.894-.088%201.165-.264a.86.86%200%200%200%20.415-.758.777.777%200%200%200-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902%201.902%200%200%201-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136%201.006-.136.175%200%20.359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69%200%200%201%20.24.2.43.43%200%200%201%20.071.263v.375c0%20.168-.064.256-.184.256a.83.83%200%200%201-.303-.096%203.652%203.652%200%200%200-1.532-.311c-.455%200-.815.071-1.062.223-.248.152-.375.383-.375.71%200%20.224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44%201.237.767.247.327.367.702.367%201.117%200%20.343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698%2016.207c-2.626%201.94-6.442%202.969-9.722%202.969-4.598%200-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351%203.384%201.963%207.559%203.153%2011.877%203.153%202.914%200%206.114-.607%209.06-1.852.439-.2.814.287.383.607zM22.792%2014.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36%201.5-1.053%203.967-.75%204.254-.399.287.36-.08%202.826-1.485%204.007-.215.184-.423.088-.327-.151.32-.79%201.03-2.57.695-2.994z'/%3e%3c/svg%3e",c="data:image/svg+xml,%3csvg%20width='416'%20height='426'%20viewBox='0%200%20416%20426'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='415.632'%20height='425.055'%20fill='%23004E23'/%3e%3cpath%20d='M317.301%20182.114V237.681H289.766L286.153%20232.679L277.49%20220.689L271.591%20212.526L261.508%20198.571L264.557%20212.526L268.964%20232.679L270.056%20237.681L273.37%20252.833L277.49%20271.685L277.774%20272.987L282.178%20293.138L286.585%20313.292H224.406L219.999%20293.138L217.769%20282.929L215.595%20272.987L211.189%20252.833L207.877%20237.681L204.565%20252.833L200.158%20272.987L197.864%20283.481L195.754%20293.138L191.347%20313.292H129.048L133.455%20293.138L137.738%20273.533V273.53L138.143%20273.231L138.475%20272.987L158.05%20258.489L165.69%20252.833L177.957%20243.747L186.149%20237.681H98.332V182.114H157.722L158.05%20180.617L159.887%20172.221L164.291%20152.067L168.698%20131.914L173.102%20111.763H242.531L246.935%20131.914L247.858%20136.131L237.676%20143.671L226.336%20152.067L217.769%20158.413L199.123%20172.221L197.864%20173.152L185.764%20182.114H317.301Z'%20fill='%23F9F9F8'/%3e%3c/svg%3e",l="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='M4.709%2015.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0%2011.784l.055-.352.48-.321.686.06%201.52.103%202.278.158%201.652.097%202.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686%201.908%201.476%202.491%201.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97%202.97%200%2001-.104-.729L6.283.134%206.696%200l.996.134.42.364.62%201.414%201.002%202.229%201.555%203.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286%201.851-.559%202.903-.364%201.942h.212l.243-.242.985-1.306%201.652-2.064.73-.82.85-.904.547-.431h1.033l.76%201.129-.34%201.166-1.064%201.347-.881%201.142-1.264%201.7-.79%201.36.073.11.188-.02%202.856-.606%201.543-.28%201.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061%201.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093%201.068%202.006%201.81%202.509%202.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649%202.345%203.521.122%201.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674%207.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434%201.967-2.18%202.945-1.726%201.845-.414.164-.717-.37.067-.662.401-.589%202.388-3.036%201.44-1.882.93-1.086-.006-.158h-.055L4.132%2018.56l-1.13.146-.487-.456.061-.746.231-.243%201.908-1.312-.006.006z'%20fill='%23D97757'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e",t="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.336%201.816a6.95%206.95%200%200%200-6.879%205.889%207.88%207.88%200%200%201%202.24-.412A4.855%204.855%200%200%201%2011.33%203.92a4.853%204.853%200%200%201%203.45%201.44%204.793%204.793%200%200%201%201.197%202.01%207.633%207.633%200%200%201%20.875-.067h.33a8.313%208.313%200%200%201%20.976.076%206.95%206.95%200%200%200-6.822-5.564zM6.99%208.224A6.983%206.983%200%200%200%200%2015.2a6.978%206.978%200%200%200%206.977%206.976%206.966%206.966%200%200%200%204.933-2.03%20691.43%20691.43%200%200%200%201.56-1.581l-1.488-1.488-1.55%201.582a4.86%204.86%200%200%201-3.452%201.436A4.881%204.881%200%200%201%202.104%2015.2a4.877%204.877%200%200%201%204.876-4.871%204.855%204.855%200%200%201%202.819.904l.04-.043%201.466-1.465A6.969%206.969%200%200%200%206.99%208.224zm10.04%200a6.966%206.966%200%200%200-4.936%202.047l-1.59%201.574%201.488%201.489%201.58-1.584A4.88%204.88%200%200%201%2021.9%2015.2a4.881%204.881%200%200%201-4.877%204.882%204.858%204.858%200%200%201-2.83-.914l-.045.046s-1.078%201.096-1.437%201.467a6.95%206.95%200%200%200%204.312%201.504A6.983%206.983%200%200%200%2024%2015.205a6.95%206.95%200%200%200-2.04-4.933%206.962%206.962%200%200%200-4.93-2.047z'/%3e%3c/svg%3e",s="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.04%200C5.408-.02.005%205.37.005%2011.992h4.638c0-4.923%204.882-8.731%2010.064-6.855a6.95%206.95%200%20014.147%204.148c1.889%205.177-1.924%2010.055-6.84%2010.064v-4.61H7.391v4.623h4.61V24c7.86%200%2013.967-7.588%2011.397-15.83-1.115-3.59-3.985-6.446-7.575-7.575A12.8%2012.8%200%200012.039%200zM7.39%2019.362H3.828v3.564H7.39zm-3.563%200v-2.978H.85v2.978z'/%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eElevenLabs%3c/title%3e%3cpath%20d='M5%200h5v24H5V0zM14%200h5v24h-5V0z'%3e%3c/path%3e%3c/svg%3e",v="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGemini%3c/title%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='%233186FF'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-0-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-1-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-2-_R_0_)'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-0-_R_0_'%20x1='7'%20x2='11'%20y1='15.5'%20y2='12'%3e%3cstop%20stop-color='%2308B962'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%2308B962'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-1-_R_0_'%20x1='8'%20x2='11.5'%20y1='5.5'%20y2='11'%3e%3cstop%20stop-color='%23F94543'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23F94543'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-2-_R_0_'%20x1='3.5'%20x2='17.5'%20y1='13.5'%20y2='12'%3e%3cstop%20stop-color='%23FABC12'%3e%3c/stop%3e%3cstop%20offset='.46'%20stop-color='%23FABC12'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogleCloud%3c/title%3e%3cpath%20d='M15.961%207.327l2.086-2.086.14-.879C14.384.905%208.34%201.297%204.913%205.18A9.643%209.643%200%20002.88%208.991l.747-.105%204.172-.688.322-.33c1.856-2.038%204.994-2.312%207.137-.578l.703.037z'%20fill='%23EA4335'%3e%3c/path%3e%3cpath%20d='M21.02%208.93a9.399%209.399%200%2000-2.834-4.568L15.258%207.29a5.204%205.204%200%20011.91%204.129v.52a2.606%202.606%200%20012.607%202.605c0%201.44-1.167%202.577-2.606%202.577h-5.22l-.512.556v3.126l.513.49h5.219c3.743.03%206.802-2.952%206.83-6.695a6.778%206.778%200%2000-2.98-5.668z'%20fill='%234285F4'%3e%3c/path%3e%3cpath%20d='M6.738%2021.293h5.212v-4.172H6.738c-.371%200-.731-.08-1.069-.234l-.74.227-2.1%202.086-.183.71a6.763%206.763%200%20004.092%201.383z'%20fill='%2334A853'%3e%3c/path%3e%3cpath%20d='M6.738%207.759A6.778%206.778%200%20002.646%2019.91l3.023-3.023a2.606%202.606%200%20113.448-3.448l3.023-3.023a6.771%206.771%200%2000-5.402-2.657z'%20fill='%23FBBC05'%3e%3c/path%3e%3c/svg%3e",i="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGroq%3c/title%3e%3cpath%20d='M12.036%202c-3.853-.035-7%203-7.036%206.781-.035%203.782%203.055%206.872%206.908%206.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362%201.901-4.298%204.308-4.326h.1c2.407%200%204.358%201.915%204.365%204.278v6.305c0%202.342-1.944%204.25-4.323%204.279a4.375%204.375%200%2001-3.033-1.252l-1.851%201.818A7%207%200%200012.029%2022h.092c3.803-.056%206.858-3.083%206.879-6.816v-6.5C18.907%204.963%2015.817%202%2012.036%202z'%3e%3c/path%3e%3c/svg%3e",n="/assets/hermes-CiVWQ9gt.svg",p="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%200v24h24V0H0zm4.602%204.025h2.244c.509%200%20.716.215.716.717v5.64h8.883v-5.64c0-.509.215-.717.717-.717h2.229c.5%200%20.71.23.724.717v14.516c0%20.509-.215.717-.717.717h-2.23c-.51%200-.717-.215-.717-.717v-5.735H7.562v5.735c0%20.516-.215.717-.716.717H4.602c-.51%200-.717-.208-.717-.717V4.742c0-.509.207-.717.717-.717z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.415%200v7.16l5.785%203.384V2.949L16.415%200ZM1.8%200v11.237h18.815L14.89%208.09l-7.457-.003V3.024L1.8%200Zm14.615%2020.894v-5.019l-7.514-.005c.007.033-5.82-3.197-5.82-3.197l19.119.091V24l-5.785-3.106ZM1.8%2013.551v7.343l5.633%202.949v-6.988L1.8%2013.551Z'/%3e%3c/svg%3e",w="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAJoklEQVR4nO2dMW9URxSF7y+AH4BxnyDXUSSXIAp3RETKNiBBERcgQcNKRIIqFg1d7MalaegSN3QgGlcuXLhysxI/YH/CRGelEasFr9m3M+/cd+cURxHg2Gfv+97xzLy588zMkqQaWJwa0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDkmqQBLQgUBCYEloQWPga0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDkmqQBLQgUBCYEloQWPga0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDTen6tWvpn7dv0vH7o9l/dx8/TNu//jL7e7Y3iyG6gaa0c/dOmn65+K4+f/hvBjkAZ/u04YpuoBkBVCTzZUAv6uhwP43u36P7tmGJbiC1nsxX6ezk0yy5N29u0D+H+RfdQDPa3LiR9l69TGcnHzvDLbBNQPsDe6Mz0Fl/v3qpxLbv1pd/gVvSn48epsn56dpA56GIxtgmoFkwv3j2pAjIGobYsjrzU6sFlRhmXJXWW7d+on9OB6IbaGbJribQWbuPHtA/K1l0A82scPQB9PTLxWxow/68RNENNDMZ7AvoadtQ0w00IYxx+wR6+uWi1RUQuoHwwsajUkt1q2hyftriRJFuoAkBrHWeEHbV2cmn1nby0Q0MRthLsXP39mzLJ57U4TF01vj50yvBwcQQX9c32EeH+/Ta9Si6AbcCoBiHAtjFIQOgxN/j31fdNJTB7hPqnbu36fXsSXQDLh+CIIEXIcafAWLerwzgATP+/D1dBTrA3n/7prfx9PU2hh50A+66SS7bfA+Y8e9I5x+d5OHr9l6/XPpzkfJ9DEPGz5/Sa9yD6AbCbBrKw5AubVVI69pQT85PW9ihRzdAFaBbpYtkUfh/AXAJUODl6PBAKW0CuvNYucsDjwzxfAKXTL7Lhj0aS5sSetm68KpDDICchxIY92LiiLE1ulBKN7bWhHoceyxNN9C7/rh/byUAAG1euchLeIAbUNdaOcD3xc+tldLm4DpUEt2A622cWKGY79YGDH3tkcBEsdYj8+24RyXQDfQ6Zl4FEAwlMKyYH3L0vZa7Trf49IoblX09KoluoDetMgEE+PNfzxx3rrMKM71E+Gzs61FJdAPu+/nYk6hazQGbMdek6QZc9/O9Ozyg+4dqPCLfffyQ/rkqiG6gurougeHJ3ebNG3T/tXoS99++oX+uCqIbcJvO3jo+So+lP3/4l/6ZKohuwGU6Ax6290VhiFAS6EnM9Wi6gWrCElukddoak8PNeBNDuoFqwpCh69iZ7f0ylX7QshWv55BuoJq67lzzPPsvvRtvJ14nC92AuzTznFp7r/8qCvTo99/on6mw6AaqaOvWzyEnSqV7EUcCehjqugfC4+pGiXnBVEAPW11/Nb9z3vIvoO2qGvEvkqfJk/enZ6WB3tGkcBjq+lTNO9Clx9DbDtfb1xTdQBV17aD2DnTpVY4txys6HUU3UEVRgS69Dn093uEzdAOugPa+YafksbwT50uUHUU34Apoz0dmlX5Py7HzJcqOohuoonVOIfI6USq9wjGOeZwB3UAVrXMEgNcG0tJvAdh2euOuKboBd5Mnj2PL0uk8jTkhhOgGXC5veetWKZ3OxzHHzxDdgMtE89TmX+MNtCNnN2xB0Q242m3nbdKER9OlYZ7OOlV8NP9WEN2A6+4O5pO0LgdKTgNswFpTdAOun6ph6MHou6sF8zTu6kYW3YD7Lum+oS7xNoHpAPslC4luYBAvvOwDavidPxyyhkZxJ4NZdAODOZwFN8fuoweDS+VpO+kM0Q0M7ggtpHWJpEMiY1jU13vAR/HTOT7QtY6jzWADyFVWQpa9zLOm9p1vixXQ5MfGi8qvqcAYGOvX88Lf4fXEjHd9T50dOimgnaf0EDRqY6iRRTcw2LH0ELTndOeggC5QhNovtfSms5OPUXfULRPdwCDXpb3rrK1xc5tAtzL0mJyfRuzmFtB9HQXgSZO2YYboBiiKOJ6eCOZ2ga756mHWmHmr7WTOohugQs162FFSuDEbnQAmAR0sqbHO3ODSXBLQS4oAIIY2UcR4OeDJoUlAOz7Zs+ZGI6WyXXYd6XeUu1eneR1XYz9K8PapVEB0Ay6FDT1ewBbIJqAjgC2QTQldM7H7eBgDiNE0oDGyacjR1xgbcGNiViK58T3QvSKIrdQ14o9Xhw44JmoAcm/WmXIwS1kIsEL5zwAXX4OvxWvnlMJW45rwoZBUAxPQgkBBYEpoQWDRa0A3IKkGSUALAgWBKaEFgYWvAd2ApBokAS0IFASmhBYEFr4GdAOSapAEtCBQEJgSegYB9lDgNH50SWMfBlqZsOEIwj6L+VNDsf8iCyeI5n0ZEHoR836Ny4Svmf9/8D3y98s/Bz8TPxteIPhivNfFYohuoKgAAgAFJBnCDN5QjwGbvzHwmXCjLd4EugEsFtB4pcOQu7drnFM9un+vRdDpBoqIDZJnHb8/aumMaLqBImr5QPMf1YtnT+jXSUA7eu1EBG3H7xqnGyjWOcKGZQg6O/kUvVOGbsDNy+pb0fj5U/r1EtBLirC5sdHbu/6irIRsxl39oBtYWxo/rw718fsj+nUT0MGPxe1bo5hLeXQD4c+k8zz0uB5vgkg30OQJol40jjdBpBuodrqRHrZctJjSdAPV4dYej4uWUppuoJrwVAybdIa6y64vTc5P6ddKQC8pAvYTa7hx0eojcbqB4sJeYXbqDU17cV5yTzdQRUic+dNAtaR3sRRoHA/MvmYCesUiYDafOzyg3HaVW6Gg3B413zaV26nYKVpT4zgTQ7qBQQp7Ieb7EnFj4Mzn+Zsl9yd6/y1xdvIx0tId3UBz+tqce+eb3xDzvyW+NucefNOcW3LlZhwnnSG6AWnNGuA3Rb5Bdue61hdvjHnlbvNAqxsC2kHxJRPQgkA3QlJCC4LUSA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgJTQgsCC18DugFJNUgCWhAoCEwJLQgsfA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgJTQgsCC18DugFJNUgCWhAoCEwJLQgsfA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgL7tgb/A6oyzIW++c0FAAAAAElFTkSuQmCC",A="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.182%2015.499a1.7634%201.7634%200%200%201-.3536-.0358%201.8319%201.8319%200%200%201-1.2086-.8632l-.0066-.012c-.1308-.2616-.0448-.5693.2-.7162a.5236.5236%200%200%201%20.2689-.0743.5327.5327%200%200%201%20.4632.272.558.558%200%200%200%20.018.0299l.0564.0766.0757.0765a.7385.7385%200%200%200%20.3453.167.7596.7596%200%200%200%20.5954-.136.7206.7206%200%200%200%20.299-.5386.7441.7441%200%200%200-.207-.578s-1.5994-1.6612-1.6712-1.7382a1.9604%201.9604%200%200%201-.1929-.229c-.2256-.3198-.2962-.697-.2614-1.0702a1.7361%201.7361%200%200%201%20.2253-.7397s.0732-.124.0948-.1554c.0847-.1236.2515-.2834.3658-.3726a1.8813%201.8813%200%200%201%20.3069-.1844%201.7494%201.7494%200%200%201%202.2815.7041.5186.5186%200%200%201%20.0553.402.5298.5298%200%200%201-.2528.3263.5082.5082%200%200%201-.2593.0705.5283.5283%200%200%201-.46-.2706.6953.6953%200%200%200-.4656-.329.721.721%200%200%200-.5645.1269.688.688%200%200%200-.267.498.6998.6998%200%200%200%20.1905.5398l1.6351%201.6862a1.8284%201.8284%200%200%201%20.5071%201.3931c-.0465.5243-.3071.9994-.7152%201.3053a1.8425%201.8425%200%200%201-1.0984.369m-5.175-.0006a1.7608%201.7608%200%200%200%201.7585-1.7589v-3.4787a1.7587%201.7587%200%200%200-3.5173%200v3.4786a1.7608%201.7608%200%200%200%201.7587%201.7589m0-5.9342c.3777%200%20.6968.319.6968.6967v3.4786a.6977.6977%200%200%201-.6968.6968.6894.6894%200%200%201-.6968-.6968v-3.4786a.6976.6976%200%200%201%20.697-.6967m-7.8986.3224v5.0804a.5309.5309%200%200%200%201.0618%200V12.09Zm2.8802%202.0255V9.0328a.531.531%200%200%201%201.0619%200v5.0828zm1.053%202.9406v.1134a.533.533%200%200%201-1.0067.2408L9.1153%209.154v-.1212a.5261.5261%200%200%201%20.3028-.4772.5253.5253%200%200%201%20.7088.2475Zm-7.9067.6457a1.761%201.761%200%200%200%201.7586-1.7589v-3.4786a1.7587%201.7587%200%200%200-3.5173%200v3.4786a1.7609%201.7609%200%200%200%201.7587%201.7589m0-5.9342a.707.707%200%200%201%20.6968.6967v3.4786a.6968.6968%200%201%201-1.3936%200v-3.4786a.6976.6976%200%200%201%20.6968-.6967M0%2014.9111a.5791.5791%200%201%200%201.1581%200V9.0803a.5791.5791%200%200%200-1.1582%200z'/%3e%3c/svg%3e",_="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.006%2010.684a.15.15%200%200%200-.07-.15l-3.261-1.821a.14.14%200%200%200-.14%200l-2.771%201.69a.17.17%200%200%200-.07.13v1.451l-1.13-.74a.14.14%200%200%200-.15%200l-1.62%201-.071-1.64a.19.19%200%200%200-.07-.12l-1.65-1.09%201.51-.781a.16.16%200%200%200%20.08-.14l-.27-6.272a.16.16%200%200%200-.08-.13L8%200h-.1L2.08%201.81A.16.16%200%200%200%202%202l1.27%206.233a.22.22%200%200%200%200%20.08l1.83%201.38-1.26.6a.16.16%200%200%200-.08.17l1%204.702a.18.18%200%200%200%200%20.07L6%2016.375l-.8.49a.15.15%200%200%200-.06.16l.75%203.642a.11.11%200%200%200%200%20.07l3.002%203.221a.14.14%200%200%200%20.2%200l3.921-3.121a.16.16%200%200%200%20.06-.12l-.07-2.12%201.32%201.1a.14.14%200%200%200%20.18%200l3.142-2.511a.24.24%200%200%200%20.06-.11l.09-1.57%201%20.67a.14.14%200%200%200%20.17%200l2.571-2.001a.14.14%200%200%200%20.05-.1zm-9.623.15l.07%201.57.12%202.781-4.231%202.871-.66-4.532zm-.35-8.423l.25%205.912-5.002%202.59-.9-6.321zM3.54%208.123L2.33%202.26l3.74%202.32.931%206.203-1.58-1.2zM5%2015.055l-.88-4.261%203.281%202.74.6%204.382-1.68-1.62zm1.14%205.512l-.65-3.141%202.892%202.85.47%203.162zm3.002%203l-.49-3.33%204.001-2.871.14%203.28zm3.861-5.36v-1.081a.16.16%200%200%200-.05-.11l-1.13-.92%201-.7a.14.14%200%200%200%20.06-.12v-.261l1.39%201.06v3.211zm4.442-1.201l-2.861%202.28v-3.22l3.07-2.201zm1.29-1.21l-.9-.631.09-1.59a.11.11%200%200%200%200-.06.1.1%200%200%200%200-.05l-1.93-1.27v-1.391l3%201.89zm2.55-1.861l-2.28%201.81.26-3.06%202.431-1.681z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNvidia%3c/title%3e%3cpath%20d='M10.212%208.976V7.62c.127-.01.256-.017.388-.021%203.596-.117%205.957%203.184%205.957%203.184s-2.548%203.647-5.282%203.647a3.227%203.227%200%2001-1.063-.175v-4.109c1.4.174%201.681.812%202.523%202.258l1.873-1.627a4.905%204.905%200%2000-3.67-1.846%206.594%206.594%200%2000-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024%205.002-.174%208.261%204.226%208.261%204.226s-3.743%204.69-7.643%204.69c-.338%200-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057%203.629%200%206.253-1.91%208.794-4.169.421.347%202.146%201.193%202.501%201.564-2.416%202.083-8.048%203.763-11.24%203.763-.308%200-.603-.02-.894-.048V19.5H24v-15H10.21zm0%209.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173%207.173%200%20014.287-2.138v1.172h-.005a3.182%203.182%200%2000-2.502%201.178s.615%202.276%202.507%202.931m-5.961-3.3c1.436-1.935%203.604-3.148%205.961-3.336V6.523C5.81%206.887%202%2010.723%202%2010.723s2.158%206.427%208.21%207.015v-1.166C5.77%2016%204.25%2010.958%204.25%2010.958h-.002z'%20fill='%2374B71B'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e",m="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M7.905%201.09c.216.085.411.225.588.41.295.306.544.744.734%201.263.191.522.315%201.1.362%201.68a5.054%205.054%200%20012.049-.636l.051-.004c.87-.07%201.73.087%202.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67%201.67%200%2001.589-.41c.257-.1.53-.118.796-.042.401.114.745.368%201.016.737.248.337.434.769.561%201.287.23.934.27%202.163.115%203.645l.053.04.026.019c.757.576%201.284%201.397%201.563%202.35.435%201.487.216%203.155-.534%204.088l-.018.021.002.003c.417.762.67%201.567.724%202.4l.002.03c.064%201.065-.2%202.137-.814%203.19l-.007.01.01.024c.472%201.157.62%202.322.438%203.486l-.006.039a.651.651%200%2001-.747.536.648.648%200%2001-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643%200%2001.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644%200%2001.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229%204.229%200%2000-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653%200%2001-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288%203.288%200%2000-1.772-.332c-1.245.099-2.343.801-2.67%201.686a.652.652%200%2001-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066%201.588a4.07%204.07%200%2000-.068%201.886c.112.558.331%201.02.582%201.269l.008.007c.212.207.257.53.109.785-.36.622-.629%201.549-.673%202.44-.05%201.018.186%201.902.719%202.536l.016.019a.643.643%200%2001.095.69c-.576%201.236-.753%202.252-.562%203.052a.652.652%200%2001-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339%204.339%200%2001-.598-1.309l-.005-.019a5.764%205.764%200%2001-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352%205.352%200%2001.093-2.49c.262-.915.777-1.701%201.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622%201.015-.737.266-.076.54-.059.797.042zm4.116%209.09c.936%200%201.8.313%202.446.855.63.527%201.005%201.235%201.005%201.94%200%20.888-.406%201.58-1.133%202.022-.62.375-1.451.557-2.403.557-1.009%200-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845%200-.707.398-1.417%201.056-1.946.668-.537%201.55-.849%202.485-.849zm0%20.896a3.07%203.07%200%2000-1.916.65c-.461.37-.722.835-.722%201.25%200%20.428.21.829.61%201.134.455.347%201.124.548%201.943.548.799%200%201.473-.147%201.932-.426.463-.28.7-.686.7-1.257%200-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662%201.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375%200%2001-.376.373.375.375%200%2001-.376-.373v-.46l-.271-.218a.347.347%200%2001-.052-.49.353.353%200%2001.494-.051l.215.172.22-.174a.353.353%200%2001.49.051zm-5.04-1.919c.478%200%20.867.39.867.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zm8.706%200c.48%200%20.868.39.868.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zM7.44%202.3l-.003.002a.659.659%200%2000-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216%201.631-.124%202.782.43-.128.899-.208%201.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628%200%2000-.107-.09L7.44%202.3zm9.174.04l-.002.001a.628.628%200%2000-.107.09c-.156.163-.32.45-.453.814-.29.794-.387%201.776-.23%202.572l.058.097.008.014h.03a5.184%205.184%200%20011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659%200%2000-.285-.239h-.004z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenClaw%3c/title%3e%3cpath%20d='M12%202.568c-6.33%200-9.495%205.275-9.495%209.495%200%204.22%203.165%208.44%206.33%209.494v2.11h2.11v-2.11s1.055.422%202.11%200v2.11h2.11v-2.11c3.165-1.055%206.33-5.274%206.33-9.494S18.33%202.568%2012%202.568z'%20fill='url(%23lobe-icons-open-claw-0-_R_0_)'%3e%3c/path%3e%3cpath%20d='M3.56%209.953C.396%208.898-.66%2011.008.396%2013.118c1.055%202.11%203.164%201.055%204.22-1.055.632-1.477%200-2.11-1.056-2.11z'%20fill='url(%23lobe-icons-open-claw-1-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.44%209.953c3.164-1.055%204.22%201.055%203.164%203.165-1.055%202.11-3.164%201.055-4.22-1.055-.632-1.477%200-2.11%201.056-2.11z'%20fill='url(%23lobe-icons-open-claw-2-_R_0_)'%3e%3c/path%3e%3cpath%20d='M5.507%201.875c.476-.285%201.036-.233%201.615.037.577.27%201.223.774%201.937%201.488a.316.316%200%2001-.447.447c-.693-.693-1.279-1.138-1.757-1.361-.475-.222-.795-.205-1.022-.069a.317.317%200%2001-.326-.542zM16.877%201.913c.58-.27%201.14-.323%201.616-.038a.317.317%200%2001-.326.542c-.227-.136-.547-.153-1.022.069-.478.223-1.064.668-1.756%201.361a.316.316%200%2011-.448-.447c.714-.714%201.36-1.218%201.936-1.487z'%20fill='%23FF4D4D'%3e%3c/path%3e%3cpath%20d='M8.835%209.109a1.266%201.266%200%20100-2.532%201.266%201.266%200%20000%202.532zM15.165%209.109a1.266%201.266%200%20100-2.532%201.266%201.266%200%20000%202.532z'%20fill='%23050810'%3e%3c/path%3e%3cpath%20d='M9.046%208.16a.527.527%200%20100-1.056.527.527%200%20000%201.055zM15.376%208.16a.527.527%200%20100-1.055.527.527%200%20000%201.054z'%20fill='%2300E5CC'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-0-_R_0_'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-1-_R_0_'%20x1='0'%20x2='4.311'%20y1='9.672'%20y2='14.949'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-2-_R_0_'%20x1='19.385'%20x2='24.399'%20y1='9.953'%20y2='14.462'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M18.654%203.87a5.087%205.087%200%20110%2010.174L23.7%2019.09c.64.641.187%201.737-.72%201.737H8.48a8.479%208.479%200%20010-16.958h10.175zM8.479%207.26a5.087%205.087%200%20100%2010.176%205.087%205.087%200%20000-10.175z'%3e%3c/path%3e%3c/svg%3e",z="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.412%204.412h-8.82a7.588%207.588%200%200%200-.008%2015.176h8.828a7.588%207.588%200%200%200%200-15.176zm-.193%2012.502H7.786a4.915%204.915%200%200%201%200-9.828h8.433a4.914%204.914%200%201%201%200%209.828z'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.881%2010.095l2.563-4.45C23.434%207.389%2024%209.404%2024%2011.555c0%202.88-1.017%205.523-2.71%207.594h-6.62l2.04-3.541h-2.696l3.176-5.513h2.691zm-2.32-5.243L9.333%2019.14l.003.009H2.709C1.014%2017.077%200%2014.435%200%2011.555c0-2.152.57-4.17%201.561-5.918L5.855%2013.1%2010.6%204.852h6.961z'/%3e%3c/svg%3e",C="/assets/raspberrypi-CW7KYKqj.svg",b="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.36%202.172A1.194%201.194%200%20007.348%201.6H1.2A1.2%201.2%200%20000%202.8a1.211%201.211%200%2000.182.64l11.6%2018.4a1.206%201.206%200%20002.035%200l3.075-4.874a1.229%201.229%200%2000.182-.64%201.211%201.211%200%2000-.182-.642zm10.349%208.68a1.206%201.206%200%20002.035%200L21.8%209.178l2.017-3.2a1.211%201.211%200%2000.183-.64%201.229%201.229%200%2000-.183-.64l-1.6-2.526a1.206%201.206%200%2000-1.016-.571h-6.148a1.2%201.2%200%2000-1.201%201.2%201.143%201.143%200%2000.188.64z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGrok%3c/title%3e%3cpath%20d='M9.27%2015.29l7.978-5.897c.391-.29.95-.177%201.137.272.98%202.369.542%205.215-1.41%207.169-1.951%201.954-4.667%202.382-7.149%201.406l-2.711%201.257c3.889%202.661%208.611%202.003%2011.562-.953%202.341-2.344%203.066-5.539%202.388-8.42l.006.007c-.983-4.232.242-5.924%202.75-9.383.06-.082.12-.164.179-.248l-3.301%203.305v-.01L9.267%2015.292M7.623%2016.723c-2.792-2.67-2.31-6.801.071-9.184%201.761-1.763%204.647-2.483%207.166-1.425l2.705-1.25a7.808%207.808%200%2000-1.829-1A8.975%208.975%200%20005.984%205.83c-2.533%202.536-3.33%206.436-1.962%209.764%201.022%202.487-.653%204.246-2.34%206.022-.599.63-1.199%201.259-1.682%201.925l7.62-6.815'%3e%3c/path%3e%3c/svg%3e";export{f as _,b as a,C as b,L as c,z as d,B as e,x as f,r as g,m as h,d as i,_ as j,A as k,w as l,h as m,p as n,n as o,i as p,g as q,v as r,o as s,s as t,t as u,l as v,c as w,a as x,e as y};
+const e="/assets/antigravity-_lOIeRhP.svg",a="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.763%2010.036c0%20.296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183%200%20.08-.048.16-.152.24l-.503.335a.383.383%200%200%201-.208.072c-.08%200-.16-.04-.239-.112a2.47%202.47%200%200%201-.287-.375%206.18%206.18%200%200%201-.248-.471c-.622.734-1.405%201.101-2.347%201.101-.67%200-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533%200-.678.239-1.23.726-1.644.487-.415%201.133-.623%201.955-.623.272%200%20.551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28%200-.568.031-.863.103-.295.072-.583.16-.862.272a2.287%202.287%200%200%201-.28.104.488.488%200%200%201-.127.023c-.112%200-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597%200%200%201%20.224-.167c.279-.144.614-.264%201.005-.36a4.84%204.84%200%200%201%201.246-.151c.95%200%201.644.216%202.091.647.439.43.662%201.085.662%201.963v2.586zm-3.24%201.214c.263%200%20.534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66%206.66%200%200%200-.735-.136%206.02%206.02%200%200%200-.75-.048c-.535%200-.926.104-1.19.32-.263.215-.39.518-.39.917%200%20.375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144%200-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586%205.55a1.398%201.398%200%200%201-.072-.32c0-.128.064-.2.191-.2h.783c.151%200%20.255.025.31.08.065.048.113.16.16.312l1.342%205.284%201.245-5.284c.04-.16.088-.264.151-.312a.549.549%200%200%201%20.32-.08h.638c.152%200%20.256.025.32.08.063.048.12.16.151.312l1.261%205.348%201.381-5.348c.048-.16.104-.264.16-.312a.52.52%200%200%201%20.311-.08h.743c.127%200%20.2.065.2.2%200%20.04-.009.08-.017.128a1.137%201.137%200%200%201-.056.2l-1.923%206.17c-.048.16-.104.263-.168.311a.51.51%200%200%201-.303.08h-.687c-.151%200-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23%205.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415%200-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563%200%200%201-.048-.224v-.407c0-.167.064-.247.183-.247.048%200%20.096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502%200%20.894-.088%201.165-.264a.86.86%200%200%200%20.415-.758.777.777%200%200%200-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902%201.902%200%200%201-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136%201.006-.136.175%200%20.359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69%200%200%201%20.24.2.43.43%200%200%201%20.071.263v.375c0%20.168-.064.256-.184.256a.83.83%200%200%201-.303-.096%203.652%203.652%200%200%200-1.532-.311c-.455%200-.815.071-1.062.223-.248.152-.375.383-.375.71%200%20.224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44%201.237.767.247.327.367.702.367%201.117%200%20.343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698%2016.207c-2.626%201.94-6.442%202.969-9.722%202.969-4.598%200-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351%203.384%201.963%207.559%203.153%2011.877%203.153%202.914%200%206.114-.607%209.06-1.852.439-.2.814.287.383.607zM22.792%2014.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36%201.5-1.053%203.967-.75%204.254-.399.287.36-.08%202.826-1.485%204.007-.215.184-.423.088-.327-.151.32-.79%201.03-2.57.695-2.994z'/%3e%3c/svg%3e",c="data:image/svg+xml,%3csvg%20width='416'%20height='426'%20viewBox='0%200%20416%20426'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='415.632'%20height='425.055'%20fill='%23004E23'/%3e%3cpath%20d='M317.301%20182.114V237.681H289.766L286.153%20232.679L277.49%20220.689L271.591%20212.526L261.508%20198.571L264.557%20212.526L268.964%20232.679L270.056%20237.681L273.37%20252.833L277.49%20271.685L277.774%20272.987L282.178%20293.138L286.585%20313.292H224.406L219.999%20293.138L217.769%20282.929L215.595%20272.987L211.189%20252.833L207.877%20237.681L204.565%20252.833L200.158%20272.987L197.864%20283.481L195.754%20293.138L191.347%20313.292H129.048L133.455%20293.138L137.738%20273.533V273.53L138.143%20273.231L138.475%20272.987L158.05%20258.489L165.69%20252.833L177.957%20243.747L186.149%20237.681H98.332V182.114H157.722L158.05%20180.617L159.887%20172.221L164.291%20152.067L168.698%20131.914L173.102%20111.763H242.531L246.935%20131.914L247.858%20136.131L237.676%20143.671L226.336%20152.067L217.769%20158.413L199.123%20172.221L197.864%20173.152L185.764%20182.114H317.301Z'%20fill='%23F9F9F8'/%3e%3c/svg%3e",l="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='M4.709%2015.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0%2011.784l.055-.352.48-.321.686.06%201.52.103%202.278.158%201.652.097%202.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686%201.908%201.476%202.491%201.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97%202.97%200%2001-.104-.729L6.283.134%206.696%200l.996.134.42.364.62%201.414%201.002%202.229%201.555%203.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286%201.851-.559%202.903-.364%201.942h.212l.243-.242.985-1.306%201.652-2.064.73-.82.85-.904.547-.431h1.033l.76%201.129-.34%201.166-1.064%201.347-.881%201.142-1.264%201.7-.79%201.36.073.11.188-.02%202.856-.606%201.543-.28%201.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061%201.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093%201.068%202.006%201.81%202.509%202.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649%202.345%203.521.122%201.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674%207.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434%201.967-2.18%202.945-1.726%201.845-.414.164-.717-.37.067-.662.401-.589%202.388-3.036%201.44-1.882.93-1.086-.006-.158h-.055L4.132%2018.56l-1.13.146-.487-.456.061-.746.231-.243%201.908-1.312-.006.006z'%20fill='%23D97757'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e",t="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.336%201.816a6.95%206.95%200%200%200-6.879%205.889%207.88%207.88%200%200%201%202.24-.412A4.855%204.855%200%200%201%2011.33%203.92a4.853%204.853%200%200%201%203.45%201.44%204.793%204.793%200%200%201%201.197%202.01%207.633%207.633%200%200%201%20.875-.067h.33a8.313%208.313%200%200%201%20.976.076%206.95%206.95%200%200%200-6.822-5.564zM6.99%208.224A6.983%206.983%200%200%200%200%2015.2a6.978%206.978%200%200%200%206.977%206.976%206.966%206.966%200%200%200%204.933-2.03%20691.43%20691.43%200%200%200%201.56-1.581l-1.488-1.488-1.55%201.582a4.86%204.86%200%200%201-3.452%201.436A4.881%204.881%200%200%201%202.104%2015.2a4.877%204.877%200%200%201%204.876-4.871%204.855%204.855%200%200%201%202.819.904l.04-.043%201.466-1.465A6.969%206.969%200%200%200%206.99%208.224zm10.04%200a6.966%206.966%200%200%200-4.936%202.047l-1.59%201.574%201.488%201.489%201.58-1.584A4.88%204.88%200%200%201%2021.9%2015.2a4.881%204.881%200%200%201-4.877%204.882%204.858%204.858%200%200%201-2.83-.914l-.045.046s-1.078%201.096-1.437%201.467a6.95%206.95%200%200%200%204.312%201.504A6.983%206.983%200%200%200%2024%2015.205a6.95%206.95%200%200%200-2.04-4.933%206.962%206.962%200%200%200-4.93-2.047z'/%3e%3c/svg%3e",s="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.04%200C5.408-.02.005%205.37.005%2011.992h4.638c0-4.923%204.882-8.731%2010.064-6.855a6.95%206.95%200%20014.147%204.148c1.889%205.177-1.924%2010.055-6.84%2010.064v-4.61H7.391v4.623h4.61V24c7.86%200%2013.967-7.588%2011.397-15.83-1.115-3.59-3.985-6.446-7.575-7.575A12.8%2012.8%200%200012.039%200zM7.39%2019.362H3.828v3.564H7.39zm-3.563%200v-2.978H.85v2.978z'/%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eElevenLabs%3c/title%3e%3cpath%20d='M5%200h5v24H5V0zM14%200h5v24h-5V0z'%3e%3c/path%3e%3c/svg%3e",v="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGemini%3c/title%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='%233186FF'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-0-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-1-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-2-_R_0_)'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-0-_R_0_'%20x1='7'%20x2='11'%20y1='15.5'%20y2='12'%3e%3cstop%20stop-color='%2308B962'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%2308B962'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-1-_R_0_'%20x1='8'%20x2='11.5'%20y1='5.5'%20y2='11'%3e%3cstop%20stop-color='%23F94543'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23F94543'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-2-_R_0_'%20x1='3.5'%20x2='17.5'%20y1='13.5'%20y2='12'%3e%3cstop%20stop-color='%23FABC12'%3e%3c/stop%3e%3cstop%20offset='.46'%20stop-color='%23FABC12'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogleCloud%3c/title%3e%3cpath%20d='M15.961%207.327l2.086-2.086.14-.879C14.384.905%208.34%201.297%204.913%205.18A9.643%209.643%200%20002.88%208.991l.747-.105%204.172-.688.322-.33c1.856-2.038%204.994-2.312%207.137-.578l.703.037z'%20fill='%23EA4335'%3e%3c/path%3e%3cpath%20d='M21.02%208.93a9.399%209.399%200%2000-2.834-4.568L15.258%207.29a5.204%205.204%200%20011.91%204.129v.52a2.606%202.606%200%20012.607%202.605c0%201.44-1.167%202.577-2.606%202.577h-5.22l-.512.556v3.126l.513.49h5.219c3.743.03%206.802-2.952%206.83-6.695a6.778%206.778%200%2000-2.98-5.668z'%20fill='%234285F4'%3e%3c/path%3e%3cpath%20d='M6.738%2021.293h5.212v-4.172H6.738c-.371%200-.731-.08-1.069-.234l-.74.227-2.1%202.086-.183.71a6.763%206.763%200%20004.092%201.383z'%20fill='%2334A853'%3e%3c/path%3e%3cpath%20d='M6.738%207.759A6.778%206.778%200%20002.646%2019.91l3.023-3.023a2.606%202.606%200%20113.448-3.448l3.023-3.023a6.771%206.771%200%2000-5.402-2.657z'%20fill='%23FBBC05'%3e%3c/path%3e%3c/svg%3e",i="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGroq%3c/title%3e%3cpath%20d='M12.036%202c-3.853-.035-7%203-7.036%206.781-.035%203.782%203.055%206.872%206.908%206.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362%201.901-4.298%204.308-4.326h.1c2.407%200%204.358%201.915%204.365%204.278v6.305c0%202.342-1.944%204.25-4.323%204.279a4.375%204.375%200%2001-3.033-1.252l-1.851%201.818A7%207%200%200012.029%2022h.092c3.803-.056%206.858-3.083%206.879-6.816v-6.5C18.907%204.963%2015.817%202%2012.036%202z'%3e%3c/path%3e%3c/svg%3e",n="/assets/hermes-CiVWQ9gt.svg",p="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%200v24h24V0H0zm4.602%204.025h2.244c.509%200%20.716.215.716.717v5.64h8.883v-5.64c0-.509.215-.717.717-.717h2.229c.5%200%20.71.23.724.717v14.516c0%20.509-.215.717-.717.717h-2.23c-.51%200-.717-.215-.717-.717v-5.735H7.562v5.735c0%20.516-.215.717-.716.717H4.602c-.51%200-.717-.208-.717-.717V4.742c0-.509.207-.717.717-.717z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.415%200v7.16l5.785%203.384V2.949L16.415%200ZM1.8%200v11.237h18.815L14.89%208.09l-7.457-.003V3.024L1.8%200Zm14.615%2020.894v-5.019l-7.514-.005c.007.033-5.82-3.197-5.82-3.197l19.119.091V24l-5.785-3.106ZM1.8%2013.551v7.343l5.633%202.949v-6.988L1.8%2013.551Z'/%3e%3c/svg%3e",w="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAJoklEQVR4nO2dMW9URxSF7y+AH4BxnyDXUSSXIAp3RETKNiBBERcgQcNKRIIqFg1d7MalaegSN3QgGlcuXLhysxI/YH/CRGelEasFr9m3M+/cd+cURxHg2Gfv+97xzLy588zMkqQaWJwa0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDkmqQBLQgUBCYEloQWPga0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDkmqQBLQgUBCYEloQWPga0A1IqkES0IJAQWBKaEFg4WtANyCpBklACwIFgSmhBYGFrwHdgKQaJAEtCBQEpoQWBBa+BnQDTen6tWvpn7dv0vH7o9l/dx8/TNu//jL7e7Y3iyG6gaa0c/dOmn65+K4+f/hvBjkAZ/u04YpuoBkBVCTzZUAv6uhwP43u36P7tmGJbiC1nsxX6ezk0yy5N29u0D+H+RfdQDPa3LiR9l69TGcnHzvDLbBNQPsDe6Mz0Fl/v3qpxLbv1pd/gVvSn48epsn56dpA56GIxtgmoFkwv3j2pAjIGobYsjrzU6sFlRhmXJXWW7d+on9OB6IbaGbJribQWbuPHtA/K1l0A82scPQB9PTLxWxow/68RNENNDMZ7AvoadtQ0w00IYxx+wR6+uWi1RUQuoHwwsajUkt1q2hyftriRJFuoAkBrHWeEHbV2cmn1nby0Q0MRthLsXP39mzLJ57U4TF01vj50yvBwcQQX9c32EeH+/Ta9Si6AbcCoBiHAtjFIQOgxN/j31fdNJTB7hPqnbu36fXsSXQDLh+CIIEXIcafAWLerwzgATP+/D1dBTrA3n/7prfx9PU2hh50A+66SS7bfA+Y8e9I5x+d5OHr9l6/XPpzkfJ9DEPGz5/Sa9yD6AbCbBrKw5AubVVI69pQT85PW9ihRzdAFaBbpYtkUfh/AXAJUODl6PBAKW0CuvNYucsDjwzxfAKXTL7Lhj0aS5sSetm68KpDDICchxIY92LiiLE1ulBKN7bWhHoceyxNN9C7/rh/byUAAG1euchLeIAbUNdaOcD3xc+tldLm4DpUEt2A622cWKGY79YGDH3tkcBEsdYj8+24RyXQDfQ6Zl4FEAwlMKyYH3L0vZa7Trf49IoblX09KoluoDetMgEE+PNfzxx3rrMKM71E+Gzs61FJdAPu+/nYk6hazQGbMdek6QZc9/O9Ozyg+4dqPCLfffyQ/rkqiG6gurougeHJ3ebNG3T/tXoS99++oX+uCqIbcJvO3jo+So+lP3/4l/6ZKohuwGU6Ax6290VhiFAS6EnM9Wi6gWrCElukddoak8PNeBNDuoFqwpCh69iZ7f0ylX7QshWv55BuoJq67lzzPPsvvRtvJ14nC92AuzTznFp7r/8qCvTo99/on6mw6AaqaOvWzyEnSqV7EUcCehjqugfC4+pGiXnBVEAPW11/Nb9z3vIvoO2qGvEvkqfJk/enZ6WB3tGkcBjq+lTNO9Clx9DbDtfb1xTdQBV17aD2DnTpVY4txys6HUU3UEVRgS69Dn093uEzdAOugPa+YafksbwT50uUHUU34Apoz0dmlX5Py7HzJcqOohuoonVOIfI6USq9wjGOeZwB3UAVrXMEgNcG0tJvAdh2euOuKboBd5Mnj2PL0uk8jTkhhOgGXC5veetWKZ3OxzHHzxDdgMtE89TmX+MNtCNnN2xB0Q242m3nbdKER9OlYZ7OOlV8NP9WEN2A6+4O5pO0LgdKTgNswFpTdAOun6ph6MHou6sF8zTu6kYW3YD7Lum+oS7xNoHpAPslC4luYBAvvOwDavidPxyyhkZxJ4NZdAODOZwFN8fuoweDS+VpO+kM0Q0M7ggtpHWJpEMiY1jU13vAR/HTOT7QtY6jzWADyFVWQpa9zLOm9p1vixXQ5MfGi8qvqcAYGOvX88Lf4fXEjHd9T50dOimgnaf0EDRqY6iRRTcw2LH0ELTndOeggC5QhNovtfSms5OPUXfULRPdwCDXpb3rrK1xc5tAtzL0mJyfRuzmFtB9HQXgSZO2YYboBiiKOJ6eCOZ2ga756mHWmHmr7WTOohugQs162FFSuDEbnQAmAR0sqbHO3ODSXBLQS4oAIIY2UcR4OeDJoUlAOz7Zs+ZGI6WyXXYd6XeUu1eneR1XYz9K8PapVEB0Ay6FDT1ewBbIJqAjgC2QTQldM7H7eBgDiNE0oDGyacjR1xgbcGNiViK58T3QvSKIrdQ14o9Xhw44JmoAcm/WmXIwS1kIsEL5zwAXX4OvxWvnlMJW45rwoZBUAxPQgkBBYEpoQWDRa0A3IKkGSUALAgWBKaEFgYWvAd2ApBokAS0IFASmhBYEFr4GdAOSapAEtCBQEJgSegYB9lDgNH50SWMfBlqZsOEIwj6L+VNDsf8iCyeI5n0ZEHoR836Ny4Svmf9/8D3y98s/Bz8TPxteIPhivNfFYohuoKgAAgAFJBnCDN5QjwGbvzHwmXCjLd4EugEsFtB4pcOQu7drnFM9un+vRdDpBoqIDZJnHb8/aumMaLqBImr5QPMf1YtnT+jXSUA7eu1EBG3H7xqnGyjWOcKGZQg6O/kUvVOGbsDNy+pb0fj5U/r1EtBLirC5sdHbu/6irIRsxl39oBtYWxo/rw718fsj+nUT0MGPxe1bo5hLeXQD4c+k8zz0uB5vgkg30OQJol40jjdBpBuodrqRHrZctJjSdAPV4dYej4uWUppuoJrwVAybdIa6y64vTc5P6ddKQC8pAvYTa7hx0eojcbqB4sJeYXbqDU17cV5yTzdQRUic+dNAtaR3sRRoHA/MvmYCesUiYDafOzyg3HaVW6Gg3B413zaV26nYKVpT4zgTQ7qBQQp7Ieb7EnFj4Mzn+Zsl9yd6/y1xdvIx0tId3UBz+tqce+eb3xDzvyW+NucefNOcW3LlZhwnnSG6AWnNGuA3Rb5Bdue61hdvjHnlbvNAqxsC2kHxJRPQgkA3QlJCC4LUSA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgJTQgsCC18DugFJNUgCWhAoCEwJLQgsfA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgJTQgsCC18DugFJNUgCWhAoCEwJLQgsfA3oBiTVIAloQaAgMCW0ILDwNaAbkFSDJKAFgYLAlNCCwMLXgG5AUg2SgBYECgL7tgb/A6oyzIW++c0FAAAAAElFTkSuQmCC",A="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.182%2015.499a1.7634%201.7634%200%200%201-.3536-.0358%201.8319%201.8319%200%200%201-1.2086-.8632l-.0066-.012c-.1308-.2616-.0448-.5693.2-.7162a.5236.5236%200%200%201%20.2689-.0743.5327.5327%200%200%201%20.4632.272.558.558%200%200%200%20.018.0299l.0564.0766.0757.0765a.7385.7385%200%200%200%20.3453.167.7596.7596%200%200%200%20.5954-.136.7206.7206%200%200%200%20.299-.5386.7441.7441%200%200%200-.207-.578s-1.5994-1.6612-1.6712-1.7382a1.9604%201.9604%200%200%201-.1929-.229c-.2256-.3198-.2962-.697-.2614-1.0702a1.7361%201.7361%200%200%201%20.2253-.7397s.0732-.124.0948-.1554c.0847-.1236.2515-.2834.3658-.3726a1.8813%201.8813%200%200%201%20.3069-.1844%201.7494%201.7494%200%200%201%202.2815.7041.5186.5186%200%200%201%20.0553.402.5298.5298%200%200%201-.2528.3263.5082.5082%200%200%201-.2593.0705.5283.5283%200%200%201-.46-.2706.6953.6953%200%200%200-.4656-.329.721.721%200%200%200-.5645.1269.688.688%200%200%200-.267.498.6998.6998%200%200%200%20.1905.5398l1.6351%201.6862a1.8284%201.8284%200%200%201%20.5071%201.3931c-.0465.5243-.3071.9994-.7152%201.3053a1.8425%201.8425%200%200%201-1.0984.369m-5.175-.0006a1.7608%201.7608%200%200%200%201.7585-1.7589v-3.4787a1.7587%201.7587%200%200%200-3.5173%200v3.4786a1.7608%201.7608%200%200%200%201.7587%201.7589m0-5.9342c.3777%200%20.6968.319.6968.6967v3.4786a.6977.6977%200%200%201-.6968.6968.6894.6894%200%200%201-.6968-.6968v-3.4786a.6976.6976%200%200%201%20.697-.6967m-7.8986.3224v5.0804a.5309.5309%200%200%200%201.0618%200V12.09Zm2.8802%202.0255V9.0328a.531.531%200%200%201%201.0619%200v5.0828zm1.053%202.9406v.1134a.533.533%200%200%201-1.0067.2408L9.1153%209.154v-.1212a.5261.5261%200%200%201%20.3028-.4772.5253.5253%200%200%201%20.7088.2475Zm-7.9067.6457a1.761%201.761%200%200%200%201.7586-1.7589v-3.4786a1.7587%201.7587%200%200%200-3.5173%200v3.4786a1.7609%201.7609%200%200%200%201.7587%201.7589m0-5.9342a.707.707%200%200%201%20.6968.6967v3.4786a.6968.6968%200%201%201-1.3936%200v-3.4786a.6976.6976%200%200%201%20.6968-.6967M0%2014.9111a.5791.5791%200%201%200%201.1581%200V9.0803a.5791.5791%200%200%200-1.1582%200z'/%3e%3c/svg%3e",_="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22.006%2010.684a.15.15%200%200%200-.07-.15l-3.261-1.821a.14.14%200%200%200-.14%200l-2.771%201.69a.17.17%200%200%200-.07.13v1.451l-1.13-.74a.14.14%200%200%200-.15%200l-1.62%201-.071-1.64a.19.19%200%200%200-.07-.12l-1.65-1.09%201.51-.781a.16.16%200%200%200%20.08-.14l-.27-6.272a.16.16%200%200%200-.08-.13L8%200h-.1L2.08%201.81A.16.16%200%200%200%202%202l1.27%206.233a.22.22%200%200%200%200%20.08l1.83%201.38-1.26.6a.16.16%200%200%200-.08.17l1%204.702a.18.18%200%200%200%200%20.07L6%2016.375l-.8.49a.15.15%200%200%200-.06.16l.75%203.642a.11.11%200%200%200%200%20.07l3.002%203.221a.14.14%200%200%200%20.2%200l3.921-3.121a.16.16%200%200%200%20.06-.12l-.07-2.12%201.32%201.1a.14.14%200%200%200%20.18%200l3.142-2.511a.24.24%200%200%200%20.06-.11l.09-1.57%201%20.67a.14.14%200%200%200%20.17%200l2.571-2.001a.14.14%200%200%200%20.05-.1zm-9.623.15l.07%201.57.12%202.781-4.231%202.871-.66-4.532zm-.35-8.423l.25%205.912-5.002%202.59-.9-6.321zM3.54%208.123L2.33%202.26l3.74%202.32.931%206.203-1.58-1.2zM5%2015.055l-.88-4.261%203.281%202.74.6%204.382-1.68-1.62zm1.14%205.512l-.65-3.141%202.892%202.85.47%203.162zm3.002%203l-.49-3.33%204.001-2.871.14%203.28zm3.861-5.36v-1.081a.16.16%200%200%200-.05-.11l-1.13-.92%201-.7a.14.14%200%200%200%20.06-.12v-.261l1.39%201.06v3.211zm4.442-1.201l-2.861%202.28v-3.22l3.07-2.201zm1.29-1.21l-.9-.631.09-1.59a.11.11%200%200%200%200-.06.1.1%200%200%200%200-.05l-1.93-1.27v-1.391l3%201.89zm2.55-1.861l-2.28%201.81.26-3.06%202.431-1.681z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNvidia%3c/title%3e%3cpath%20d='M10.212%208.976V7.62c.127-.01.256-.017.388-.021%203.596-.117%205.957%203.184%205.957%203.184s-2.548%203.647-5.282%203.647a3.227%203.227%200%2001-1.063-.175v-4.109c1.4.174%201.681.812%202.523%202.258l1.873-1.627a4.905%204.905%200%2000-3.67-1.846%206.594%206.594%200%2000-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024%205.002-.174%208.261%204.226%208.261%204.226s-3.743%204.69-7.643%204.69c-.338%200-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057%203.629%200%206.253-1.91%208.794-4.169.421.347%202.146%201.193%202.501%201.564-2.416%202.083-8.048%203.763-11.24%203.763-.308%200-.603-.02-.894-.048V19.5H24v-15H10.21zm0%209.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173%207.173%200%20014.287-2.138v1.172h-.005a3.182%203.182%200%2000-2.502%201.178s.615%202.276%202.507%202.931m-5.961-3.3c1.436-1.935%203.604-3.148%205.961-3.336V6.523C5.81%206.887%202%2010.723%202%2010.723s2.158%206.427%208.21%207.015v-1.166C5.77%2016%204.25%2010.958%204.25%2010.958h-.002z'%20fill='%2374B71B'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e",m="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M7.905%201.09c.216.085.411.225.588.41.295.306.544.744.734%201.263.191.522.315%201.1.362%201.68a5.054%205.054%200%20012.049-.636l.051-.004c.87-.07%201.73.087%202.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67%201.67%200%2001.589-.41c.257-.1.53-.118.796-.042.401.114.745.368%201.016.737.248.337.434.769.561%201.287.23.934.27%202.163.115%203.645l.053.04.026.019c.757.576%201.284%201.397%201.563%202.35.435%201.487.216%203.155-.534%204.088l-.018.021.002.003c.417.762.67%201.567.724%202.4l.002.03c.064%201.065-.2%202.137-.814%203.19l-.007.01.01.024c.472%201.157.62%202.322.438%203.486l-.006.039a.651.651%200%2001-.747.536.648.648%200%2001-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643%200%2001.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644%200%2001.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229%204.229%200%2000-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653%200%2001-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288%203.288%200%2000-1.772-.332c-1.245.099-2.343.801-2.67%201.686a.652.652%200%2001-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066%201.588a4.07%204.07%200%2000-.068%201.886c.112.558.331%201.02.582%201.269l.008.007c.212.207.257.53.109.785-.36.622-.629%201.549-.673%202.44-.05%201.018.186%201.902.719%202.536l.016.019a.643.643%200%2001.095.69c-.576%201.236-.753%202.252-.562%203.052a.652.652%200%2001-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339%204.339%200%2001-.598-1.309l-.005-.019a5.764%205.764%200%2001-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352%205.352%200%2001.093-2.49c.262-.915.777-1.701%201.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622%201.015-.737.266-.076.54-.059.797.042zm4.116%209.09c.936%200%201.8.313%202.446.855.63.527%201.005%201.235%201.005%201.94%200%20.888-.406%201.58-1.133%202.022-.62.375-1.451.557-2.403.557-1.009%200-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845%200-.707.398-1.417%201.056-1.946.668-.537%201.55-.849%202.485-.849zm0%20.896a3.07%203.07%200%2000-1.916.65c-.461.37-.722.835-.722%201.25%200%20.428.21.829.61%201.134.455.347%201.124.548%201.943.548.799%200%201.473-.147%201.932-.426.463-.28.7-.686.7-1.257%200-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662%201.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375%200%2001-.376.373.375.375%200%2001-.376-.373v-.46l-.271-.218a.347.347%200%2001-.052-.49.353.353%200%2001.494-.051l.215.172.22-.174a.353.353%200%2001.49.051zm-5.04-1.919c.478%200%20.867.39.867.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zm8.706%200c.48%200%20.868.39.868.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zM7.44%202.3l-.003.002a.659.659%200%2000-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216%201.631-.124%202.782.43-.128.899-.208%201.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628%200%2000-.107-.09L7.44%202.3zm9.174.04l-.002.001a.628.628%200%2000-.107.09c-.156.163-.32.45-.453.814-.29.794-.387%201.776-.23%202.572l.058.097.008.014h.03a5.184%205.184%200%20011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659%200%2000-.285-.239h-.004z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenClaw%3c/title%3e%3cpath%20d='M12%202.568c-6.33%200-9.495%205.275-9.495%209.495%200%204.22%203.165%208.44%206.33%209.494v2.11h2.11v-2.11s1.055.422%202.11%200v2.11h2.11v-2.11c3.165-1.055%206.33-5.274%206.33-9.494S18.33%202.568%2012%202.568z'%20fill='url(%23lobe-icons-open-claw-0-_R_0_)'%3e%3c/path%3e%3cpath%20d='M3.56%209.953C.396%208.898-.66%2011.008.396%2013.118c1.055%202.11%203.164%201.055%204.22-1.055.632-1.477%200-2.11-1.056-2.11z'%20fill='url(%23lobe-icons-open-claw-1-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.44%209.953c3.164-1.055%204.22%201.055%203.164%203.165-1.055%202.11-3.164%201.055-4.22-1.055-.632-1.477%200-2.11%201.056-2.11z'%20fill='url(%23lobe-icons-open-claw-2-_R_0_)'%3e%3c/path%3e%3cpath%20d='M5.507%201.875c.476-.285%201.036-.233%201.615.037.577.27%201.223.774%201.937%201.488a.316.316%200%2001-.447.447c-.693-.693-1.279-1.138-1.757-1.361-.475-.222-.795-.205-1.022-.069a.317.317%200%2001-.326-.542zM16.877%201.913c.58-.27%201.14-.323%201.616-.038a.317.317%200%2001-.326.542c-.227-.136-.547-.153-1.022.069-.478.223-1.064.668-1.756%201.361a.316.316%200%2011-.448-.447c.714-.714%201.36-1.218%201.936-1.487z'%20fill='%23FF4D4D'%3e%3c/path%3e%3cpath%20d='M8.835%209.109a1.266%201.266%200%20100-2.532%201.266%201.266%200%20000%202.532zM15.165%209.109a1.266%201.266%200%20100-2.532%201.266%201.266%200%20000%202.532z'%20fill='%23050810'%3e%3c/path%3e%3cpath%20d='M9.046%208.16a.527.527%200%20100-1.056.527.527%200%20000%201.055zM15.376%208.16a.527.527%200%20100-1.055.527.527%200%20000%201.054z'%20fill='%2300E5CC'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-0-_R_0_'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-1-_R_0_'%20x1='0'%20x2='4.311'%20y1='9.672'%20y2='14.949'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-open-claw-2-_R_0_'%20x1='19.385'%20x2='24.399'%20y1='9.953'%20y2='14.462'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",x="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M18.654%203.87a5.087%205.087%200%20110%2010.174L23.7%2019.09c.64.641.187%201.737-.72%201.737H8.48a8.479%208.479%200%20010-16.958h10.175zM8.479%207.26a5.087%205.087%200%20100%2010.176%205.087%205.087%200%20000-10.175z'%3e%3c/path%3e%3c/svg%3e",z="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.412%204.412h-8.82a7.588%207.588%200%200%200-.008%2015.176h8.828a7.588%207.588%200%200%200%200-15.176zm-.193%2012.502H7.786a4.915%204.915%200%200%201%200-9.828h8.433a4.914%204.914%200%201%201%200%209.828z'/%3e%3c/svg%3e",L="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.881%2010.095l2.563-4.45C23.434%207.389%2024%209.404%2024%2011.555c0%202.88-1.017%205.523-2.71%207.594h-6.62l2.04-3.541h-2.696l3.176-5.513h2.691zm-2.32-5.243L9.333%2019.14l.003.009H2.709C1.014%2017.077%200%2014.435%200%2011.555c0-2.152.57-4.17%201.561-5.918L5.855%2013.1%2010.6%204.852h6.961z'/%3e%3c/svg%3e",C="/assets/raspberrypi-CW7KYKqj.svg",b="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.36%202.172A1.194%201.194%200%20007.348%201.6H1.2A1.2%201.2%200%20000%202.8a1.211%201.211%200%2000.182.64l11.6%2018.4a1.206%201.206%200%20002.035%200l3.075-4.874a1.229%201.229%200%2000.182-.64%201.211%201.211%200%2000-.182-.642zm10.349%208.68a1.206%201.206%200%20002.035%200L21.8%209.178l2.017-3.2a1.211%201.211%200%2000.183-.64%201.229%201.229%200%2000-.183-.64l-1.6-2.526a1.206%201.206%200%2000-1.016-.571h-6.148a1.2%201.2%200%2000-1.201%201.2%201.143%201.143%200%2000.188.64z'/%3e%3c/svg%3e",f="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGrok%3c/title%3e%3cpath%20d='M9.27%2015.29l7.978-5.897c.391-.29.95-.177%201.137.272.98%202.369.542%205.215-1.41%207.169-1.951%201.954-4.667%202.382-7.149%201.406l-2.711%201.257c3.889%202.661%208.611%202.003%2011.562-.953%202.341-2.344%203.066-5.539%202.388-8.42l.006.007c-.983-4.232.242-5.924%202.75-9.383.06-.082.12-.164.179-.248l-3.301%203.305v-.01L9.267%2015.292M7.623%2016.723c-2.792-2.67-2.31-6.801.071-9.184%201.761-1.763%204.647-2.483%207.166-1.425l2.705-1.25a7.808%207.808%200%2000-1.829-1A8.975%208.975%200%20005.984%205.83c-2.533%202.536-3.33%206.436-1.962%209.764%201.022%202.487-.653%204.246-2.34%206.022-.599.63-1.199%201.259-1.682%201.925l7.62-6.815'%3e%3c/path%3e%3c/svg%3e";export{f as _,b as a,C as b,L as c,z as d,x as e,B as f,r as g,m as h,d as i,_ as j,A as k,w as l,h as m,p as n,n as o,i as p,g as q,v as r,o as s,s as t,t as u,l as v,c as w,a as x,e as y};
diff --git a/dodaios/ui/web/frontend/src/hooks/useWebSocket.permissions.test.tsx b/dodaios/ui/web/frontend/src/hooks/useWebSocket.permissions.test.tsx
index f29a74dec9..801b4388b3 100644
--- a/dodaios/ui/web/frontend/src/hooks/useWebSocket.permissions.test.tsx
+++ b/dodaios/ui/web/frontend/src/hooks/useWebSocket.permissions.test.tsx
@@ -128,7 +128,7 @@ describe("useWebSocket permission wiring", () => {
MockWebSocket.last!.deliver(envelope("PermissionNeeded", needed));
- expect(await screen.findByText("Personal Jarvis needs microphone access to hear you.")).toBeTruthy();
+ expect(await screen.findByText("Dodaios needs microphone access to hear you.")).toBeTruthy();
expect(screen.getAllByTestId("toast-action")).toHaveLength(1);
expect(screen.getByTestId("toast-action").textContent).toBe("Open System Settings");
});
@@ -224,7 +224,7 @@ describe("useWebSocket permission wiring", () => {
MockWebSocket.last!.deliver({ type: "welcome", session_id: "s1" });
await waitFor(() => expect(useEventStore.getState().toasts.length).toBeGreaterThan(0));
- expect(await screen.findByText("Personal Jarvis needs microphone access to hear you.")).toBeTruthy();
+ expect(await screen.findByText("Dodaios needs microphone access to hear you.")).toBeTruthy();
expect(screen.getByText(/The wake word cannot listen/)).toBeTruthy();
// The person lets them expire; the socket reconnects: nothing is repeated.
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/de.json b/dodaios/ui/web/frontend/src/i18n/locales/de.json
index 64c881e7f5..27078430b7 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/de.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/de.json
@@ -3036,18 +3036,18 @@
"vision_note": "Es werden nur Modelle angezeigt, die Bilder verstehen - Computer-Use liest den Bildschirm über Screenshots, ein reines Text-Modell kann es nicht steuern."
},
"permissions": {
- "restart_failed": "Personal Jarvis konnte nicht neu starten. Beende und öffne es manuell erneut.",
+ "restart_failed": "Dodaios konnte nicht neu starten. Beende und öffne es manuell erneut.",
"toast": {
- "microphone": "Personal Jarvis braucht Zugriff auf das Mikrofon, um dich zu hören.",
- "screen_recording": "Personal Jarvis braucht Zugriff auf die Bildschirmaufnahme, um deinen Bildschirm zu sehen.",
- "accessibility": "Personal Jarvis braucht Zugriff auf die Bedienungshilfen, um andere Apps für dich zu steuern.",
- "input_monitoring": "Personal Jarvis braucht Zugriff auf die Eingabeüberwachung, damit deine Kürzel auch in anderen Apps funktionieren.",
- "automation": "Personal Jarvis braucht deine Erlaubnis, eine andere App zu steuern.",
- "generic": "Personal Jarvis braucht dafür eine weitere Berechtigung.",
- "restricted": "Dein Mac erlaubt Personal Jarvis den Zugriff auf {what} nicht. Das kann nur ein Administrator ändern.",
- "restart": "Der Zugriff auf {what} ist an, wirkt aber erst, wenn Personal Jarvis neu startet.",
- "outside": "Personal Jarvis braucht Zugriff auf {what}; da es nicht als App installiert ist, gibt macOS den Zugriff an die App, die es gestartet hat.",
- "wake_word": "Das Wake-Word kann nicht zuhören: Der Mikrofonzugriff ist für Personal Jarvis ausgeschaltet.",
+ "microphone": "Dodaios braucht Zugriff auf das Mikrofon, um dich zu hören.",
+ "screen_recording": "Dodaios braucht Zugriff auf die Bildschirmaufnahme, um deinen Bildschirm zu sehen.",
+ "accessibility": "Dodaios braucht Zugriff auf die Bedienungshilfen, um andere Apps für dich zu steuern.",
+ "input_monitoring": "Dodaios braucht Zugriff auf die Eingabeüberwachung, damit deine Kürzel auch in anderen Apps funktionieren.",
+ "automation": "Dodaios braucht deine Erlaubnis, eine andere App zu steuern.",
+ "generic": "Dodaios braucht dafür eine weitere Berechtigung.",
+ "restricted": "Dein Mac erlaubt Dodaios den Zugriff auf {what} nicht. Das kann nur ein Administrator ändern.",
+ "restart": "Der Zugriff auf {what} ist an, wirkt aber erst, wenn Dodaios neu startet.",
+ "outside": "Dodaios braucht Zugriff auf {what}; da es nicht als App installiert ist, gibt macOS den Zugriff an die App, die es gestartet hat.",
+ "wake_word": "Das Wake-Word kann nicht zuhören: Der Mikrofonzugriff ist für Dodaios ausgeschaltet.",
"action_failed": "Das hat nicht geklappt. Bitte öffne die Systemeinstellungen selbst.",
"name": {
"microphone": "das Mikrofon",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/en.json b/dodaios/ui/web/frontend/src/i18n/locales/en.json
index 10069b5d6c..5609c416db 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/en.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/en.json
@@ -3036,18 +3036,18 @@
"vision_note": "Only models that can see images are listed - Computer-Use reads the screen from screenshots, so a text-only model cannot run it."
},
"permissions": {
- "restart_failed": "Personal Jarvis could not restart. Quit and reopen it manually.",
+ "restart_failed": "Dodaios could not restart. Quit and reopen it manually.",
"toast": {
- "microphone": "Personal Jarvis needs microphone access to hear you.",
- "screen_recording": "Personal Jarvis needs screen recording access to see your screen.",
- "accessibility": "Personal Jarvis needs accessibility access to control other apps for you.",
- "input_monitoring": "Personal Jarvis needs input monitoring access so your shortcuts work in other apps.",
- "automation": "Personal Jarvis needs your permission to control another app.",
- "generic": "Personal Jarvis needs another permission to do that.",
- "restricted": "Your Mac does not allow Personal Jarvis to use {what}. Only an administrator can change that.",
- "restart": "Access to {what} is on, but it only works after Personal Jarvis restarts.",
- "outside": "Personal Jarvis needs access to {what}; as it is not an installed app, macOS gives that access to the app that started it.",
- "wake_word": "The wake word cannot listen: microphone access is off for Personal Jarvis.",
+ "microphone": "Dodaios needs microphone access to hear you.",
+ "screen_recording": "Dodaios needs screen recording access to see your screen.",
+ "accessibility": "Dodaios needs accessibility access to control other apps for you.",
+ "input_monitoring": "Dodaios needs input monitoring access so your shortcuts work in other apps.",
+ "automation": "Dodaios needs your permission to control another app.",
+ "generic": "Dodaios needs another permission to do that.",
+ "restricted": "Your Mac does not allow Dodaios to use {what}. Only an administrator can change that.",
+ "restart": "Access to {what} is on, but it only works after Dodaios restarts.",
+ "outside": "Dodaios needs access to {what}; as it is not an installed app, macOS gives that access to the app that started it.",
+ "wake_word": "The wake word cannot listen: microphone access is off for Dodaios.",
"action_failed": "That did not work. Please open System Settings yourself.",
"name": {
"microphone": "the microphone",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/es.json b/dodaios/ui/web/frontend/src/i18n/locales/es.json
index 499f68564a..86937daa83 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/es.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/es.json
@@ -3036,18 +3036,18 @@
"vision_note": "Solo se muestran modelos que entienden imágenes: Computer-Use lee la pantalla mediante capturas, un modelo de solo texto no puede controlarlo."
},
"permissions": {
- "restart_failed": "Personal Jarvis no pudo reiniciarse. Ciérralo y ábrelo de nuevo manualmente.",
+ "restart_failed": "Dodaios no pudo reiniciarse. Ciérralo y ábrelo de nuevo manualmente.",
"toast": {
- "microphone": "Personal Jarvis necesita acceso al micrófono para oírte.",
- "screen_recording": "Personal Jarvis necesita acceso a la grabación de pantalla para ver tu pantalla.",
- "accessibility": "Personal Jarvis necesita acceso a la accesibilidad para controlar otras apps.",
- "input_monitoring": "Personal Jarvis necesita acceso a la monitorización de entrada para que tus atajos funcionen en otras apps.",
- "automation": "Personal Jarvis necesita tu permiso para controlar otra app.",
- "generic": "Personal Jarvis necesita otro permiso para hacer eso.",
- "restricted": "Tu Mac no permite que Personal Jarvis use {what}. Solo un administrador puede cambiarlo.",
- "restart": "El acceso a {what} está activado, pero solo funciona cuando Personal Jarvis se reinicia.",
- "outside": "Personal Jarvis necesita acceso a {what}; como no es una app instalada, macOS da ese acceso a la app que lo inició.",
- "wake_word": "La palabra de activación no puede escuchar: el acceso al micrófono está desactivado para Personal Jarvis.",
+ "microphone": "Dodaios necesita acceso al micrófono para oírte.",
+ "screen_recording": "Dodaios necesita acceso a la grabación de pantalla para ver tu pantalla.",
+ "accessibility": "Dodaios necesita acceso a la accesibilidad para controlar otras apps.",
+ "input_monitoring": "Dodaios necesita acceso a la monitorización de entrada para que tus atajos funcionen en otras apps.",
+ "automation": "Dodaios necesita tu permiso para controlar otra app.",
+ "generic": "Dodaios necesita otro permiso para hacer eso.",
+ "restricted": "Tu Mac no permite que Dodaios use {what}. Solo un administrador puede cambiarlo.",
+ "restart": "El acceso a {what} está activado, pero solo funciona cuando Dodaios se reinicia.",
+ "outside": "Dodaios necesita acceso a {what}; como no es una app instalada, macOS da ese acceso a la app que lo inició.",
+ "wake_word": "La palabra de activación no puede escuchar: el acceso al micrófono está desactivado para Dodaios.",
"action_failed": "No funcionó. Abre Ajustes del Sistema manualmente.",
"name": {
"microphone": "el micrófono",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/pt.json b/dodaios/ui/web/frontend/src/i18n/locales/pt.json
index e0c14f3b80..93d144fa03 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/pt.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/pt.json
@@ -3036,18 +3036,18 @@
"vision_note": "Só são listados modelos que conseguem ver imagens - o Computer-Use lê o ecrã a partir de capturas, por isso um modelo só de texto não o consegue executar."
},
"permissions": {
- "restart_failed": "Não foi possível reiniciar o Personal Jarvis. Fecha-o e volta a abri-lo manualmente.",
+ "restart_failed": "Não foi possível reiniciar o Dodaios. Fecha-o e volta a abri-lo manualmente.",
"toast": {
- "microphone": "O Personal Jarvis precisa de acesso ao microfone para te ouvir.",
- "screen_recording": "O Personal Jarvis precisa de acesso à gravação do ecrã para ver o teu ecrã.",
- "accessibility": "O Personal Jarvis precisa de acesso de acessibilidade para controlar outras aplicações por ti.",
- "input_monitoring": "O Personal Jarvis precisa de acesso à monitorização de entrada para que os teus atalhos funcionem noutras aplicações.",
- "automation": "O Personal Jarvis precisa da tua permissão para controlar outra aplicação.",
- "generic": "O Personal Jarvis precisa de outra permissão para fazer isso.",
- "restricted": "O teu Mac não permite que o Personal Jarvis use {what}. Só um administrador pode alterar isso.",
- "restart": "O acesso a {what} está ativo, mas só funciona depois de o Personal Jarvis reiniciar.",
- "outside": "O Personal Jarvis precisa de acesso a {what}; como não é uma aplicação instalada, o macOS dá esse acesso à aplicação que o iniciou.",
- "wake_word": "A palavra de ativação não consegue ouvir: o acesso ao microfone está desligado para o Personal Jarvis.",
+ "microphone": "O Dodaios precisa de acesso ao microfone para te ouvir.",
+ "screen_recording": "O Dodaios precisa de acesso à gravação do ecrã para ver o teu ecrã.",
+ "accessibility": "O Dodaios precisa de acesso de acessibilidade para controlar outras aplicações por ti.",
+ "input_monitoring": "O Dodaios precisa de acesso à monitorização de entrada para que os teus atalhos funcionem noutras aplicações.",
+ "automation": "O Dodaios precisa da tua permissão para controlar outra aplicação.",
+ "generic": "O Dodaios precisa de outra permissão para fazer isso.",
+ "restricted": "O teu Mac não permite que o Dodaios use {what}. Só um administrador pode alterar isso.",
+ "restart": "O acesso a {what} está ativo, mas só funciona depois de o Dodaios reiniciar.",
+ "outside": "O Dodaios precisa de acesso a {what}; como não é uma aplicação instalada, o macOS dá esse acesso à aplicação que o iniciou.",
+ "wake_word": "A palavra de ativação não consegue ouvir: o acesso ao microfone está desligado para o Dodaios.",
"action_failed": "Não funcionou. Abre tu as Definições do Sistema.",
"name": {
"microphone": "o microfone",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/zh.json b/dodaios/ui/web/frontend/src/i18n/locales/zh.json
index aa3661beac..0215b4625d 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/zh.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/zh.json
@@ -3036,18 +3036,18 @@
"vision_note": "只列出能看懂图像的模型。Computer Use 通过截图读取屏幕,纯文本模型无法运行它。"
},
"permissions": {
- "restart_failed": "Personal Jarvis 无法重启。请手动退出后重新打开。",
+ "restart_failed": "Dodaios 无法重启。请手动退出后重新打开。",
"toast": {
- "microphone": "Personal Jarvis 需要麦克风权限才能听到你说话。",
- "screen_recording": "Personal Jarvis 需要屏幕录制权限才能看到你的屏幕。",
- "accessibility": "Personal Jarvis 需要辅助功能权限才能帮你控制其他应用。",
- "input_monitoring": "Personal Jarvis 需要输入监控权限,你的快捷键才能在其他应用中生效。",
- "automation": "Personal Jarvis 需要你的许可才能控制另一个应用。",
- "generic": "Personal Jarvis 还需要一项权限才能完成此操作。",
- "restricted": "你的 Mac 不允许 Personal Jarvis 使用{what}。只有管理员可以更改此设置。",
- "restart": "{what}权限已开启,但需要重启 Personal Jarvis 后才能生效。",
- "outside": "Personal Jarvis 需要{what}权限;由于它不是已安装的应用,macOS 会把该权限授予启动它的那个应用。",
- "wake_word": "唤醒词无法监听:Personal Jarvis 的麦克风权限已关闭。",
+ "microphone": "Dodaios 需要麦克风权限才能听到你说话。",
+ "screen_recording": "Dodaios 需要屏幕录制权限才能看到你的屏幕。",
+ "accessibility": "Dodaios 需要辅助功能权限才能帮你控制其他应用。",
+ "input_monitoring": "Dodaios 需要输入监控权限,你的快捷键才能在其他应用中生效。",
+ "automation": "Dodaios 需要你的许可才能控制另一个应用。",
+ "generic": "Dodaios 还需要一项权限才能完成此操作。",
+ "restricted": "你的 Mac 不允许 Dodaios 使用{what}。只有管理员可以更改此设置。",
+ "restart": "{what}权限已开启,但需要重启 Dodaios 后才能生效。",
+ "outside": "Dodaios 需要{what}权限;由于它不是已安装的应用,macOS 会把该权限授予启动它的那个应用。",
+ "wake_word": "唤醒词无法监听:Dodaios 的麦克风权限已关闭。",
"action_failed": "操作未成功。请自行打开“系统设置”。",
"name": {
"microphone": "麦克风",
diff --git a/dodaios/ui/web/frontend/src/lib/permissionToast.test.ts b/dodaios/ui/web/frontend/src/lib/permissionToast.test.ts
index 344916215c..979a173126 100644
--- a/dodaios/ui/web/frontend/src/lib/permissionToast.test.ts
+++ b/dodaios/ui/web/frontend/src/lib/permissionToast.test.ts
@@ -206,7 +206,7 @@ describe("handlePermissionToastEvent", () => {
handle("PermissionNeeded", episode());
const t = toast();
- expect(t.message).toBe("Personal Jarvis needs microphone access to hear you.");
+ expect(t.message).toBe("Dodaios needs microphone access to hear you.");
expect(t.kind).toBe("warning");
expect(t.action?.label).toBe("Open System Settings");
expect(t.expiresAt - now).toBeGreaterThanOrEqual(PERMISSION_TOAST_TTL_MS - 50);
@@ -279,7 +279,7 @@ describe("handlePermissionToastEvent", () => {
handle("PermissionNeeded", episode({ permissions: ["screen_recording"], reason: "restart_hint" }));
const t = toast();
- expect(t.message).toBe("Access to screen recording is on, but it only works after Personal Jarvis restarts.");
+ expect(t.message).toBe("Access to screen recording is on, but it only works after Dodaios restarts.");
expect(t.action).toMatchObject({ label: "Quit and reopen", keepOpen: true });
await t.action!.onAction();
expect(restart).toHaveBeenCalledTimes(1);
diff --git a/dodaios/ui/web/launcher.py b/dodaios/ui/web/launcher.py
index 0d78ff904b..6ac49ae893 100644
--- a/dodaios/ui/web/launcher.py
+++ b/dodaios/ui/web/launcher.py
@@ -25,7 +25,6 @@ import sys
import threading
import time
-from dodaios.core.branding import CONFIG_FILE_NAME
from dodaios.core.branding import PRODUCT_NAME as APP_DISPLAY_NAME
from dodaios.core.process_utils import (
drop_inherited_electron_node_mode,
@@ -315,21 +314,31 @@ def _fast_admin_port() -> int:
return current_instance().port(_fast_admin_base_port())
+def _fast_config_path() -> str:
+ """The config file the full config load will read, without importing it.
+
+ ``JARVIS_CONFIG`` wins; otherwise the checkout's ``jarvis.toml`` while it
+ exists, else ``dodaios.toml`` (``dodaios.core.identity_boot``).
+ """
+ override = os.environ.get("JARVIS_CONFIG")
+ if override and override.strip():
+ return override.strip()
+ from dodaios.core.identity_boot import resolve_config_file
+
+ # launcher.py → dodaios/ui/web/ → repo root is three dirs up.
+ repo_root = os.path.dirname(
+ os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+ )
+ return str(resolve_config_file(repo_root))
+
+
def _fast_admin_base_port() -> int:
import contextlib
with contextlib.suppress(Exception): # any failure → packaged default
import tomllib
- override = os.environ.get("JARVIS_CONFIG")
- if override:
- path = override
- else:
- # launcher.py → dodaios/ui/web/ → repo root is three dirs up.
- repo_root = os.path.dirname(
- os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
- )
- path = os.path.join(repo_root, CONFIG_FILE_NAME)
+ path = _fast_config_path()
if os.path.exists(path):
with open(path, "rb") as fh:
data = tomllib.load(fh)
@@ -348,14 +357,7 @@ def _fast_auth_token_env() -> str:
with contextlib.suppress(Exception):
import tomllib
- override = os.environ.get("JARVIS_CONFIG")
- if override:
- path = override
- else:
- repo_root = os.path.dirname(
- os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
- )
- path = os.path.join(repo_root, CONFIG_FILE_NAME)
+ path = _fast_config_path()
if os.path.exists(path):
with open(path, "rb") as fh:
data = tomllib.load(fh)
@@ -374,14 +376,7 @@ def _fast_vite_dev_url(force_dev: bool) -> str | None:
with contextlib.suppress(Exception):
import tomllib
- override = os.environ.get("JARVIS_CONFIG")
- if override:
- path = override
- else:
- repo_root = os.path.dirname(
- os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
- )
- path = os.path.join(repo_root, CONFIG_FILE_NAME)
+ path = _fast_config_path()
if os.path.exists(path):
with open(path, "rb") as fh:
ui = tomllib.load(fh).get("ui", {})
@@ -2258,6 +2253,13 @@ def _main(argv: list[str] | None = None) -> int:
if _instance_error is not None:
_report_startup_failure(_instance_error)
return 2
+ # The data directory's earlier name: the main instance moves it to the
+ # current one now, before anything below creates or opens a file in it
+ # (instance data dir, boot trace, log sink, locks). Every other process
+ # only resolves. Reported once the log sink exists.
+ from dodaios.core.identity_boot import migrate_at_boot
+
+ _identity_report = migrate_at_boot(_raw_argv)
try:
from pathlib import Path as _IPath
@@ -2330,6 +2332,10 @@ def _main(argv: list[str] | None = None) -> int:
remember_desktop_launch_args(port=args.port, dev=args.dev, no_lock=args.no_lock)
_install_boot_trace(_raw_argv)
+ if _identity_report is not None:
+ from loguru import logger as _idlog
+
+ _idlog.log(_identity_report.level, "{}", _identity_report.message)
# Refuse a window we cannot build, BEFORE paying for the boot. Everything
# below this line — config, control key, autostart, backend, voice — takes
@@ -2404,7 +2410,7 @@ def _main(argv: list[str] | None = None) -> int:
# embedded icon, which no window-icon / class-icon / AUMID / Start-Menu /
# registry / icon-cache work can override (all verified to have no effect on
# the button). Under a bare ``pythonw.exe`` that icon is the Python logo. Re-
- # exec the SAME launcher through ``PersonalJarvis.exe`` — a pythonw copy
+ # exec the SAME launcher through ``DodaiosApp.exe`` — a pythonw copy
# carrying the mascot icon — so the taskbar shows the Jarvis ghost. Desktop
# only (headless has no taskbar), once (env-guarded), and fully best-effort:
# if branding is unavailable it returns None and we boot in-process as before.
diff --git a/dodaios/ui/web/server.py b/dodaios/ui/web/server.py
index a5f1dc515b..eb66d5fef2 100644
--- a/dodaios/ui/web/server.py
+++ b/dodaios/ui/web/server.py
@@ -33,9 +33,8 @@ from starlette.routing import Match
from starlette.types import Scope
from dodaios import __version__
-from dodaios.core.branding import CONFIG_FILE_NAME
from dodaios.core.bus import EventBus, get_default_bus
-from dodaios.core.config import JarvisConfig
+from dodaios.core.config import JarvisConfig, resolve_config_path
from dodaios.core.events import (
AnnouncementRequested,
ErrorOccurred,
@@ -2662,6 +2661,29 @@ class WebServer:
"will be renewed in the background."
)
+ def _schedule_credential_migration(self) -> None:
+ """Copy keys from the renamed credential service once, off the boot path (AP-26).
+
+ A daemon thread in the main instance only, started with a delay; reads
+ never depend on it (``get_secret`` falls back to the legacy service),
+ so a process that skips it loses nothing.
+ """
+ try:
+ from dodaios.core.identity_credentials import schedule_credential_migration
+
+ schedule_credential_migration()
+ except Exception as exc: # noqa: BLE001 -- a background copy must never block boot
+ logger.opt(exception=exc).warning("Credential copy did not schedule.")
+
+ def _schedule_distribution_check(self) -> None:
+ """Warn once, off the boot path (AP-26), when both package names are installed."""
+ try:
+ from dodaios.core.distribution import schedule_duplicate_distribution_check
+
+ schedule_duplicate_distribution_check()
+ except Exception as exc: # noqa: BLE001 -- a diagnostic must never block boot
+ logger.opt(exception=exc).debug("Duplicate distribution check did not schedule.")
+
def _schedule_appshot_shortcut(self) -> None:
"""Arm the global appshot shortcut once the wake model has loaded.
@@ -3153,6 +3175,8 @@ class WebServer:
# transport for it.
self._schedule_realtime_transport_warm()
self._schedule_appshot_shortcut()
+ self._schedule_credential_migration()
+ self._schedule_distribution_check()
# Browser provisioning includes a Chromium probe and may need Linux
# system libraries. Leave it to explicit browser use/setup; boot and
# shell-paint acknowledgements must keep headless installations usable.
@@ -3737,12 +3761,12 @@ class WebServer:
)
def _read_sessions_toml_section(self) -> dict:
- """The raw ``[sessions]`` section from jarvis.toml (may be empty).
+ """The raw ``[sessions]`` section from the config file (may be empty).
That section is NOT in the Pydantic tree (see assumption A-2 in the
Phase-7 bootstrap), hence tomllib directly.
"""
- toml_path = Path(CONFIG_FILE_NAME)
+ toml_path = resolve_config_path()
if not toml_path.exists():
return {}
try:
diff --git a/dodaios/ui/web/setup_report_routes.py b/dodaios/ui/web/setup_report_routes.py
index fbe19d7e11..abede07395 100644
--- a/dodaios/ui/web/setup_report_routes.py
+++ b/dodaios/ui/web/setup_report_routes.py
@@ -72,7 +72,7 @@ def _install_snapshot() -> dict[str, Any]:
"""Managed-install marker + profile — is this a user install or a dev tree?"""
try:
root = _update._repo_root()
- managed = bool(root is not None and (root / _update._MARKER_NAME).exists())
+ managed = bool(root is not None and _update._marker_path(root) is not None)
profile = _update._managed_install_profile(root) if root is not None else "unknown"
except Exception as exc: # noqa: BLE001 — diagnostics must never raise
log.debug("setup-report: install probe failed: %s", exc)
diff --git a/dodaios/ui/web/setup_routes.py b/dodaios/ui/web/setup_routes.py
index 4a794140dd..b65c4c46d8 100644
--- a/dodaios/ui/web/setup_routes.py
+++ b/dodaios/ui/web/setup_routes.py
@@ -38,6 +38,8 @@ from typing import Literal
from fastapi import APIRouter, HTTPException, Query, Request
from pydantic import BaseModel
+from dodaios.core.branding import LEGACY_OBSIDIAN_VAULT_FOLDER_NAMES, OBSIDIAN_VAULT_FOLDER_NAME
+from dodaios.core.identity_boot import resolve_named_dir
from dodaios.memory.wiki.vault_root import resolve_vault_root
from dodaios.setup.obsidian import (
detect_obsidian,
@@ -364,7 +366,12 @@ def obsidian_register(
active_vault_root=str(_resolve_vault_path(request)),
restart_required=False,
)
- jarvis_root = target_vault / "Jarvis"
+ # A new registration gets the current folder name. A folder an earlier
+ # registration of this vault created under the old name is reused, so
+ # the notes already in it stay the wiki.
+ jarvis_root = resolve_named_dir(
+ target_vault, OBSIDIAN_VAULT_FOLDER_NAME, LEGACY_OBSIDIAN_VAULT_FOLDER_NAMES
+ )
# ``dry_run`` previews the would-be vault root without touching disk
# or config — same contract the ``separate`` branch gives the flag.
if not dry_run:
diff --git a/dodaios/ui/web/update_routes.py b/dodaios/ui/web/update_routes.py
index dbc8738717..9f6e84d337 100644
--- a/dodaios/ui/web/update_routes.py
+++ b/dodaios/ui/web/update_routes.py
@@ -11,7 +11,8 @@ updates itself differently:
``dodaios.core.frozen.is_frozen()`` is the ONLY probe that selects this path,
so a dev tree and a managed checkout are structurally unaffected by it.
* **managed** — the one-line installer's git checkout under
- ``~/.personal-jarvis``. Updates are a ``git fetch`` of the published tag plus
+ ``~/.dodaios`` (``~/.personal-jarvis`` before the rename). Updates are a
+ ``git fetch`` of the published tag plus
a reinstall; everything below describes that path.
Anything else (a maintainer checkout, a fork, a plain ``pip install``) is
@@ -21,7 +22,7 @@ Anything else (a maintainer checkout, a fork, a plain ``pip install``) is
The managed path
----------------
An end user installs Dodaios with the one-line installer, which clones
-the public flagship repo into ``~/.personal-jarvis`` and runs the app from that
+the public flagship repo into ``~/.dodaios`` and runs the app from that
checkout. This module lets the running desktop app offer a one-click "Update
Now" button so the user never has to re-run the installer from a terminal:
@@ -40,8 +41,9 @@ Safety-critical guard (the single most important thing here):
end user's managed checkout but catastrophic in a maintainer's dev tree or any
manual clone. So the updater is active **only** on a *managed install*, proven
by BOTH:
- 1. a marker file (``.jarvis-managed-install``) that the installer writes into
- the checkout root, and
+ 1. a marker file (``.dodaios-managed-install``, or ``.jarvis-managed-install``
+ from before the rename) that the installer writes into the checkout root,
+ and
2. the checkout's ``origin`` remote resolving to the official public repo.
If either check fails, ``status`` reports ``managed: false`` (the button never
renders) and ``apply`` refuses with HTTP 403. This makes the dev tree and any
@@ -76,6 +78,7 @@ from dodaios.core.branding import (
DEFAULT_OFFICIAL_REPO_SLUG,
LEGACY_OFFICIAL_REPO_SLUGS,
MANAGED_INSTALL_MARKER,
+ MANAGED_INSTALL_MARKERS,
OFFICIAL_RELEASES_LATEST_API_URL,
OFFICIAL_REPO_GIT_URL,
OFFICIAL_REPO_SLUG,
@@ -118,6 +121,9 @@ _RELEASES_LATEST_API = OFFICIAL_RELEASES_LATEST_API_URL
# Written by install/installer.py into the checkout root. Its presence is one
# half of "this copy is safe to self-update".
_MARKER_NAME = MANAGED_INSTALL_MARKER
+# Every name the marker has had; an install made before the rename and updated
+# in-app since carries only the earlier one.
+_MARKER_NAMES = MANAGED_INSTALL_MARKERS
_PENDING_UPDATE_NAME = ".jarvis-update-pending.json"
_UPDATE_RESULT_NAME = ".jarvis-update-result.json"
@@ -466,6 +472,15 @@ async def _retarget_legacy_origin(root: Path) -> None:
)
+def _marker_path(root: Path) -> Path | None:
+ """The installer's marker in ``root`` under any of its names, current name first."""
+ for name in _MARKER_NAMES:
+ candidate = root / name
+ if candidate.exists():
+ return candidate
+ return None
+
+
async def _resolve_managed_repo() -> Path | None:
"""Return the checkout root IFF this is a managed, self-updatable install.
@@ -473,7 +488,7 @@ async def _resolve_managed_repo() -> Path | None:
official public repo. Any doubt returns ``None`` (fail-closed).
"""
root = _repo_root()
- if root is None or not (root / _MARKER_NAME).exists():
+ if root is None or _marker_path(root) is None:
return None
if not (root / ".git").exists():
return None
@@ -558,8 +573,9 @@ def _managed_install_profile(root: Path) -> InstallProfile:
profile while a display-less Linux host keeps the torch-free base floor.
"""
+ marker = _marker_path(root) or root / _MARKER_NAME
try:
- payload = json.loads((root / _MARKER_NAME).read_text(encoding="utf-8"))
+ payload = json.loads(marker.read_text(encoding="utf-8"))
except (OSError, UnicodeDecodeError, json.JSONDecodeError, TypeError):
# A source checkout has no install marker; the defaults below apply.
payload = {}
diff --git a/homebrew-tap/Formula/personal-jarvis-installer.rb b/homebrew-tap/Formula/personal-jarvis-installer.rb
deleted file mode 100644
index 7b15df5dcf..0000000000
--- a/homebrew-tap/Formula/personal-jarvis-installer.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-class PersonalJarvisInstaller < Formula
- desc "Supply-chain hardened installer for Personal Jarvis (cosign + offline Ed25519 + SLSA L3 + in-toto)"
- homepage "https://github.com/Dodaios/Dodaios"
- license "MIT"
-
- # PINNED to the v1.0.5 release.
- #
- # When the next release lands, bump `url`, `version`, and `sha256` to
- # the new release. The url MUST point at a single release asset (not a
- # source tarball), because the installer is a single executable shell
- # script that we re-publish per release with cosign + offline + SLSA +
- # ML-DSA signatures alongside it. The Homebrew tap MUST never pull from
- # `master`/`HEAD` — that defeats the whole point of Wave 4+5 (the
- # package manager's signing chain is only meaningful if the pinned
- # artifact is immutable).
- #
- # SHA-256 SOURCE OF TRUTH: the pinned release's published checksums.txt:
- # curl -fsSL https://github.com/Dodaios/Dodaios/releases/download/v1.0.5/checksums.txt \
- # | awk '/install-verify\.sh$/ {print $1}'
- url "https://github.com/Dodaios/Dodaios/releases/download/v1.0.5/install-verify.sh"
- version "1.0.5"
- sha256 "a0dc47933dc1930288b177ebd63924bffd4b35521802c82841d838bcf67eeb09"
-
- def install
- # The downloaded file is a single executable shell script (not an
- # archive). Homebrew will have placed it in the cached path under its
- # `url`-derived basename; rename it to the canonical bin name during
- # install so the user invokes `personal-jarvis-installer`, not
- # `install-verify.sh`.
- bin.install "install-verify.sh" => "personal-jarvis-installer"
- end
-
- test do
- # The installer is a 12-stage verifier that fails closed; running it
- # bare would try to download cosign + the release bundle. For a `brew
- # test` smoke check we only assert that the script is present, is the
- # right verifier (not some random shell file), and has a recognisable
- # banner. This is the strongest meaningful test we can run without
- # network + signing material in the test sandbox.
- installer = "#{bin}/personal-jarvis-installer"
- assert_predicate Pathname.new(installer), :exist?
- assert_predicate Pathname.new(installer), :executable?
- contents = File.read(installer)
- assert_match "Personal Jarvis", contents
- assert_match "supply-chain", contents
- assert_match "EXPECTED_REPO=\"PersonalJarvis/PersonalJarvis\"", contents
- end
-end
diff --git a/install/install.ps1 b/install/install.ps1
index 4f9b1bca87..de650200d1 100644
--- a/install/install.ps1
+++ b/install/install.ps1
@@ -7,7 +7,8 @@
# 1. Verifies Python 3.11+ and git are available.
# 2. Offers to install either missing prerequisite, then re-checks in place.
# 3. Checks for Node.js 18+ (optional - a missing Node never blocks the install).
-# 4. Clones (or updates) personal-jarvis into ~\.personal-jarvis.
+# 4. Clones (or updates) Dodaios into ~\.dodaios (an update moves an install
+# made under the earlier name ~\.personal-jarvis there).
# 5. Creates a Python venv, installs `rich` + `packaging`.
# 6. Hands control to install/installer.py (the Stage 2 orchestrator).
#
@@ -219,9 +220,41 @@ if ($OfficialRepoSlug -notmatch '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$') {
}
$RepoUrl = if ($env:JARVIS_INSTALL_REPO) { $env:JARVIS_INSTALL_REPO } else { "https://github.com/$OfficialRepoSlug.git" }
$LegacyOfficialRepoSlug = 'PersonalJarvis/PersonalJarvis'
-$ConfigFileName = 'jarvis.toml'
+$ConfigFileName = 'dodaios.toml'
+# An install keeps a config file under this earlier name; it is never renamed.
+$LegacyConfigFileName = 'jarvis.toml'
$Branch = if ($env:JARVIS_INSTALL_REF) { $env:JARVIS_INSTALL_REF } else { 'main' }
-$InstallDir = if ($env:JARVIS_INSTALL_DIR) { $env:JARVIS_INSTALL_DIR } else { Join-Path $env:USERPROFILE '.personal-jarvis' }
+# --- install-dir-choice begin (extracted by tests/unit/install/test_install_dir_move.py)
+# The checkout lives in ~\.dodaios. An install made under the earlier name
+# keeps its directory for as long as that is a real directory (not a junction
+# or a link), and an update run moves it (Invoke-InstallDirMigration below). A
+# directory given in JARVIS_INSTALL_DIR (or DODAIOS_INSTALL_DIR) is used as
+# given, never moved.
+$DefaultInstallDirName = '.dodaios'
+$LegacyInstallDirName = '.personal-jarvis'
+$CurrentInstallDir = Join-Path $env:USERPROFILE $DefaultInstallDirName
+$LegacyInstallDir = Join-Path $env:USERPROFILE $LegacyInstallDirName
+$MigrateLegacyInstallDir = $false
+function Test-RealDirectory([string]$Path) {
+ try {
+ $Item = Get-Item -LiteralPath $Path -Force -ErrorAction Stop
+ } catch {
+ return $false
+ }
+ return ($Item.PSIsContainer -and -not $Item.LinkType)
+}
+if ($env:JARVIS_INSTALL_DIR) {
+ $InstallDir = $env:JARVIS_INSTALL_DIR
+} elseif (Test-RealDirectory $LegacyInstallDir) {
+ $InstallDir = $LegacyInstallDir
+ $MigrateLegacyInstallDir = $true
+} else {
+ $InstallDir = $CurrentInstallDir
+}
+# --- install-dir-choice end
+# The migration engine inside the release being installed. It is read from
+# the fetched commit, never from the checkout that is about to change.
+$IdentityEnginePath = 'dodaios/core/identity_migration.py'
$PrerequisiteMode = if ($env:JARVIS_INSTALL_PREREQS) { $env:JARVIS_INSTALL_PREREQS.ToLowerInvariant() } else { 'ask' }
$InitialPath = $env:Path
@@ -607,26 +640,34 @@ function Invoke-TarballFallback {
if (-not (Get-Command tar.exe -ErrorAction SilentlyContinue)) { return $false }
if ($RepoUrl -notmatch 'github\.com/') { return $false }
$RepoPath = ($RepoUrl -split 'github\.com/', 2)[1] -replace '\.git$', ''
- $AssetUrl = "https://github.com/$RepoPath/releases/latest/download/personal-jarvis-src.tar.gz"
+ $AssetBase = "https://github.com/$RepoPath/releases/latest/download"
+ # The archive's current name first; releases cut before the rename only
+ # carry the earlier one.
+ $AssetNames = @('dodaios-src.tar.gz', 'personal-jarvis-src.tar.gz')
$SnapshotUrl = "https://codeload.github.com/$RepoPath/tar.gz/refs/heads/$Branch"
if ($env:JARVIS_PAYLOAD_COMMIT) {
# A verified install is pinned to ONE signed commit; the "latest"
# release asset cannot honor that pin, so go straight to the
# commit-addressed snapshot - the URL itself names the exact tree.
- $AssetUrl = ''
+ $AssetNames = @()
$SnapshotUrl = "https://codeload.github.com/$RepoPath/tar.gz/$($env:JARVIS_PAYLOAD_COMMIT)"
}
$Tmp = "$InstallDir.payload.tar.gz"
Write-Note 'git transfer keeps stalling on this network - switching to a resumable archive download'
$Got = $false
- $Try = 1
- while ($AssetUrl -and $Try -le 8) {
- & curl.exe -fL --speed-limit 1024 --speed-time 60 -C - -o $Tmp $AssetUrl
- if ($LASTEXITCODE -eq 0) { $Got = $true; break }
- if ($LASTEXITCODE -eq 22) { break } # HTTP error (e.g. asset missing): not retryable
- Write-Note "archive download interrupted - resuming where it stopped ($Try/8) ..."
- $Try++
- Start-Sleep -Seconds 3
+ foreach ($AssetName in $AssetNames) {
+ # A partial download of one archive must never be resumed as another.
+ try { Remove-Item -LiteralPath $Tmp -Force -ErrorAction Stop } catch {}
+ $Try = 1
+ while ($Try -le 8) {
+ & curl.exe -fL --speed-limit 1024 --speed-time 60 -C - -o $Tmp "$AssetBase/$AssetName"
+ if ($LASTEXITCODE -eq 0) { $Got = $true; break }
+ if ($LASTEXITCODE -eq 22) { break } # HTTP error (this archive is not on the release): try the next name
+ Write-Note "archive download interrupted - resuming where it stopped ($Try/8) ..."
+ $Try++
+ Start-Sleep -Seconds 3
+ }
+ if ($Got) { break }
}
if (-not $Got) {
try { Remove-Item -LiteralPath $Tmp -Force -ErrorAction Stop } catch {}
@@ -686,7 +727,7 @@ function Test-RepositoryReachable {
# Self-heal a broken install dir (leftover non-git folder from an earlier or
# aborted install, or a checkout whose git state no longer updates): keep the
# old tree as a timestamped sibling backup - never delete - clone fresh, then
-# carry the user's local state (data/, jarvis.toml, .env) into the new
+# carry the user's local state (data/, the config file, .env) into the new
# checkout. A stale folder must never require manual cleanup to install.
function Invoke-SalvageReclone {
if (-not (Test-RepositoryReachable)) {
@@ -713,7 +754,7 @@ function Invoke-SalvageReclone {
# the fresh clone ships a tracked seed wiki/ skeleton, so the guard
# would silently never restore the user's real vault. Directories that
# exist on both sides are overlay-MERGED (user files win over seed).
- foreach ($Item in @('data', $ConfigFileName, '.env', 'wiki')) {
+ foreach ($Item in @('data', $LegacyConfigFileName, $ConfigFileName, '.env', 'wiki')) {
$Old = Join-Path $StaleBackup $Item
$New = Join-Path $InstallDir $Item
if (-not (Test-Path $Old)) { continue }
@@ -824,6 +865,73 @@ function Stop-RunningApp {
}
}
+# Move an install made under the earlier directory name to the current one,
+# once the app is stopped and before the checkout changes. The engine is the
+# copy inside the fetched release, written to a temporary file outside both
+# directories byte for byte: it never passes through a PowerShell pipeline,
+# which would re-encode it. It runs isolated (-I), without writing bytecode
+# (-B), from the home directory, renames once and leaves a junction at the old
+# path, or changes nothing; the directory it reports is where the update goes
+# on. Any failure goes on in place: an install under the earlier name is a
+# valid state, not a broken one. Returns the directory to go on in; nothing
+# else may reach the output. (POSIX twin: migrate_install_dir in install.sh.)
+function Invoke-InstallDirMigration {
+ if (-not $MigrateLegacyInstallDir) { return $InstallDir }
+ # Native stderr must never become a terminating error here.
+ $ErrorActionPreference = 'Continue'
+ $Engine = Join-Path ([IO.Path]::GetTempPath()) ('dodaios-identity-migration-' + [guid]::NewGuid().ToString('N') + '.py')
+ $Report = $null
+ try {
+ if ($Branch -notmatch '^[A-Za-z0-9._/-]+$') { throw 'unusual branch name' }
+ $Git = Get-Command git -CommandType Application -ErrorAction Stop | Select-Object -First 1
+ $Start = New-Object System.Diagnostics.ProcessStartInfo
+ $Start.FileName = $Git.Source
+ $Start.Arguments = 'show "origin/' + $Branch + ':' + $IdentityEnginePath + '"'
+ $Start.WorkingDirectory = $InstallDir
+ $Start.UseShellExecute = $false
+ $Start.RedirectStandardOutput = $true
+ $Start.RedirectStandardError = $true
+ $Start.CreateNoWindow = $true
+ $Process = [System.Diagnostics.Process]::Start($Start)
+ $ErrorText = $Process.StandardError.ReadToEndAsync()
+ $Bytes = New-Object System.IO.MemoryStream
+ $Process.StandardOutput.BaseStream.CopyTo($Bytes)
+ $Process.WaitForExit()
+ [void]$ErrorText.Result
+ if ($Process.ExitCode -ne 0 -or $Bytes.Length -eq 0) { throw 'the release carries no migration engine' }
+ [IO.File]::WriteAllBytes($Engine, $Bytes.ToArray())
+ # Windows refuses to rename a folder that is any process's working
+ # directory, this one's included.
+ [Environment]::CurrentDirectory = $env:USERPROFILE
+ Push-Location -LiteralPath $env:USERPROFILE
+ try {
+ $Output = & $pythonExe -I -B $Engine migrate $LegacyInstallDir $CurrentInstallDir 2>$null
+ if ($LASTEXITCODE -eq 0) { $Report = ($Output | Out-String) | ConvertFrom-Json }
+ } finally {
+ Pop-Location
+ }
+ } catch {
+ $Report = $null
+ } finally {
+ try { Remove-Item -LiteralPath $Engine -Force -ErrorAction Stop } catch {}
+ }
+ $Effective = $null
+ if ($Report -and $Report.effective) { $Effective = [string]$Report.effective }
+ if (-not $Effective -or -not (Test-Path -LiteralPath $Effective -PathType Container)) {
+ Write-Note "kept the install in $InstallDir (the move to $CurrentInstallDir did not run)"
+ return $InstallDir
+ }
+ $Outcome = [string]$Report.outcome
+ if (@('migrated', 'link_restored', 'already_linked') -contains $Outcome) {
+ Write-Note "moved the install to $Effective (the old folder name still leads there)"
+ } elseif ($Outcome -eq 'migrated_without_link') {
+ Write-Note "moved the install to $Effective"
+ } else {
+ Write-Note "kept the install in $Effective (it could not be renamed: $Outcome)"
+ }
+ return $Effective
+}
+
# The fetch only writes inside .git, so the app keeps running through it: a
# failed download (offline, an outage) then leaves a working app behind. It is
# stopped at the last moment, right before the files it runs from change.
@@ -836,6 +944,8 @@ if (Test-Path (Join-Path $InstallDir '.git')) {
if ($LASTEXITCODE -ne 0) { $UpdateOk = $false }
if ($UpdateOk) {
Stop-RunningApp
+ $InstallDir = [string](Invoke-InstallDirMigration)
+ Set-Location -LiteralPath $InstallDir
& git checkout --quiet $Branch
if ($LASTEXITCODE -ne 0) { $UpdateOk = $false }
}
diff --git a/install/install.sh b/install/install.sh
index 4a00cdc6a2..e981e5996a 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -8,7 +8,8 @@
# 1. Verifies Python 3.11+ and git are available.
# 2. Offers to install either missing prerequisite, then re-checks in place.
# 3. Checks for Node.js 18+ (optional - a missing Node never blocks the install).
-# 4. Clones (or updates) personal-jarvis into ~/.personal-jarvis.
+# 4. Clones (or updates) Dodaios into ~/.dodaios (an update moves an install
+# made under the earlier name ~/.personal-jarvis there).
# 5. Creates a Python venv, installs `rich` + `packaging`.
# 6. Hands control to install/installer.py (the Stage 2 orchestrator).
#
@@ -52,10 +53,33 @@ if [[ ! "$OFFICIAL_REPO_SLUG" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then
fi
REPO_URL="${JARVIS_INSTALL_REPO:-https://github.com/${OFFICIAL_REPO_SLUG}.git}"
LEGACY_OFFICIAL_REPO_SLUG="PersonalJarvis/PersonalJarvis"
-CONFIG_FILE_NAME="jarvis.toml"
+CONFIG_FILE_NAME="dodaios.toml"
+# An install keeps a config file under this earlier name; it is never renamed.
+LEGACY_CONFIG_FILE_NAME="jarvis.toml"
MACOS_AUTOSTART_LABEL="com.personal-jarvis.autostart"
BRANCH="${JARVIS_INSTALL_REF:-main}"
-INSTALL_DIR="${JARVIS_INSTALL_DIR:-$HOME/.personal-jarvis}"
+# --- install-dir-choice begin (extracted by tests/unit/install/test_install_dir_move.py)
+# The checkout lives in ~/.dodaios. An install made under the earlier name
+# keeps its directory for as long as that is a real directory, and an update
+# run moves it (migrate_install_dir below). A directory given in
+# JARVIS_INSTALL_DIR (or DODAIOS_INSTALL_DIR) is used as given, never moved.
+DEFAULT_INSTALL_DIR_NAME=".dodaios"
+LEGACY_INSTALL_DIR_NAME=".personal-jarvis"
+CURRENT_INSTALL_DIR="$HOME/$DEFAULT_INSTALL_DIR_NAME"
+LEGACY_INSTALL_DIR="$HOME/$LEGACY_INSTALL_DIR_NAME"
+MIGRATE_LEGACY_INSTALL_DIR=0
+if [ -n "${JARVIS_INSTALL_DIR:-}" ]; then
+ INSTALL_DIR="$JARVIS_INSTALL_DIR"
+elif [ -d "$LEGACY_INSTALL_DIR" ] && [ ! -L "$LEGACY_INSTALL_DIR" ]; then
+ INSTALL_DIR="$LEGACY_INSTALL_DIR"
+ MIGRATE_LEGACY_INSTALL_DIR=1
+else
+ INSTALL_DIR="$CURRENT_INSTALL_DIR"
+fi
+# --- install-dir-choice end
+# The migration engine inside the release being installed. It is read from
+# the fetched commit, never from the checkout that is about to change.
+IDENTITY_ENGINE_PATH="dodaios/core/identity_migration.py"
PREREQUISITE_MODE="${JARVIS_INSTALL_PREREQS:-ask}"
# Brand palette (docs/BRAND.md): Signal Yellow on matte black, with the
@@ -995,30 +1019,40 @@ tarball_fallback() {
esac
_repo_path="${REPO_URL#*github.com/}"
_repo_path="${_repo_path%.git}"
- _asset_url="https://github.com/$_repo_path/releases/latest/download/personal-jarvis-src.tar.gz"
+ _asset_base="https://github.com/$_repo_path/releases/latest/download"
+ # The archive's current name first; releases cut before the rename only
+ # carry the earlier one.
+ _asset_names='dodaios-src.tar.gz personal-jarvis-src.tar.gz'
_snapshot_url="https://codeload.github.com/$_repo_path/tar.gz/refs/heads/$BRANCH"
if [ -n "${JARVIS_PAYLOAD_COMMIT:-}" ]; then
# A verified install is pinned to ONE signed commit; the "latest"
# release asset cannot honor that pin, so go straight to the
# commit-addressed snapshot - the URL itself names the exact tree.
- _asset_url=''
+ _asset_names=''
_snapshot_url="https://codeload.github.com/$_repo_path/tar.gz/$JARVIS_PAYLOAD_COMMIT"
fi
_tmp="${INSTALL_DIR%/}.payload.tar.gz"
note 'git transfer keeps stalling on this network - switching to a resumable archive download'
_got=''
- _try=1
- while [ -n "$_asset_url" ] && [ "$_try" -le 8 ]; do
- if curl -fL -# --speed-limit 1024 --speed-time 60 -C - -o "$_tmp" "$_asset_url"; then
- _got=1
- break
- fi
- _rc=$?
- # 22 = HTTP error (e.g. asset missing on old releases): not retryable.
- [ "$_rc" -eq 22 ] && break
- note "archive download interrupted - resuming where it stopped ($_try/8) ..."
- _try=$((_try + 1))
- sleep 3
+ for _asset_name in $_asset_names; do
+ # A partial download of one archive must never be resumed as another.
+ rm -f "$_tmp" 2>/dev/null || true
+ _try=1
+ while [ "$_try" -le 8 ]; do
+ _rc=0
+ curl -fL -# --speed-limit 1024 --speed-time 60 -C - -o "$_tmp" \
+ "$_asset_base/$_asset_name" || _rc=$?
+ if [ "$_rc" -eq 0 ]; then
+ _got=1
+ break
+ fi
+ # 22 = HTTP error (this archive is not on the release): try the next name.
+ if [ "$_rc" -eq 22 ]; then break; fi
+ note "archive download interrupted - resuming where it stopped ($_try/8) ..."
+ _try=$((_try + 1))
+ sleep 3
+ done
+ if [ -n "$_got" ]; then break; fi
done
if [ -z "$_got" ]; then
rm -f "$_tmp" 2>/dev/null || true
@@ -1052,7 +1086,7 @@ fetch_payload() {
# Self-heal a broken install dir (leftover non-git folder from an earlier or
# aborted install, or a checkout whose git state no longer updates): keep the
# old tree as a timestamped sibling backup — never delete — clone fresh, then
-# carry the user's local state (data/, jarvis.toml, .env) into the new
+# carry the user's local state (data/, the config file, .env) into the new
# checkout. A stale folder must never require manual cleanup to install.
salvage_reclone() {
local stale_backup
@@ -1103,7 +1137,7 @@ salvage_reclone() {
# exist on both sides are overlay-MERGED (user files win over seed).
# --- salvage-copy begin (extracted by tests/unit/install/test_install_salvage_copy.py)
local item
- for item in data "$CONFIG_FILE_NAME" .env wiki; do
+ for item in data "$LEGACY_CONFIG_FILE_NAME" "$CONFIG_FILE_NAME" .env wiki; do
[ -e "$stale_backup/$item" ] || continue
if [ ! -e "$INSTALL_DIR/$item" ]; then
if cp -R "$stale_backup/$item" "$INSTALL_DIR/$item"; then
@@ -1205,6 +1239,55 @@ stop_running_app() {
return 0
}
+# Move an install made under the earlier directory name to the current one.
+# It runs once the app is stopped and before the checkout changes: nothing
+# runs out of the directory, and the release about to be checked out is the
+# one that knows the new name. The engine is that release's own copy, read
+# from the fetched commit into a temporary file outside both directories and
+# run isolated (-I), without writing bytecode (-B), from the home directory.
+# It renames once and leaves a link at the old path, or changes nothing; the
+# directory it reports is where the update goes on. Any failure goes on in
+# place: an install under the earlier name is a valid state, not a broken one.
+migrate_install_dir() {
+ # --- migrate-install-dir begin (extracted by tests/unit/install/test_install_dir_move.py)
+ [ "$MIGRATE_LEGACY_INSTALL_DIR" = 1 ] || return 0
+ MIGRATE_LEGACY_INSTALL_DIR=0
+ _mig_engine="$(mktemp "${TMPDIR:-/tmp}/dodaios-identity-migration.XXXXXX" 2>/dev/null)" || return 0
+ _mig_report=''
+ if git -C "$INSTALL_DIR" show "origin/$BRANCH:$IDENTITY_ENGINE_PATH" \
+ </dev/null >"$_mig_engine" 2>/dev/null && [ -s "$_mig_engine" ]; then
+ _mig_report="$(cd "$HOME" && "$PYTHON_EXE" -I -B "$_mig_engine" migrate \
+ "$LEGACY_INSTALL_DIR" "$CURRENT_INSTALL_DIR" </dev/null 2>/dev/null)" || _mig_report=''
+ fi
+ rm -f "$_mig_engine"
+ # One JSON object; Python reads it, so no path spelling can confuse a shell parser.
+ _mig_parsed="$(printf '%s' "$_mig_report" | "$PYTHON_EXE" -I -B -c \
+ 'import json, sys; r = json.load(sys.stdin); print(r["outcome"]); print(r["effective"])' \
+ 2>/dev/null | tr -d '\r')" || _mig_parsed=''
+ _mig_nl='
+'
+ _mig_outcome="${_mig_parsed%%"$_mig_nl"*}"
+ _mig_dir="${_mig_parsed#*"$_mig_nl"}"
+ if [ -z "$_mig_parsed" ] || [ "$_mig_outcome" = "$_mig_parsed" ] || [ ! -d "$_mig_dir" ]; then
+ note "kept the install in $INSTALL_DIR (the move to $CURRENT_INSTALL_DIR did not run)"
+ return 0
+ fi
+ case "$_mig_outcome" in
+ migrated|link_restored|already_linked)
+ note "moved the install to $_mig_dir (the old folder name still leads there)"
+ ;;
+ migrated_without_link)
+ note "moved the install to $_mig_dir"
+ ;;
+ *)
+ note "kept the install in $_mig_dir (it could not be renamed: $_mig_outcome)"
+ ;;
+ esac
+ INSTALL_DIR="$_mig_dir"
+ # --- migrate-install-dir end
+ return 0
+}
+
# The fetch only writes inside .git, so the app keeps running through it: a
# failed download (offline, an outage) then leaves a working app behind. It is
# stopped at the last moment, right before the files it runs from change.
@@ -1213,6 +1296,7 @@ if [ -d "$INSTALL_DIR/.git" ]; then
# shellcheck disable=SC2086 # GIT_NET_OPTS must word-split into -c pairs
if pretty_git git $GIT_NET_OPTS -C "$INSTALL_DIR" fetch "$GIT_VERBOSITY" --depth 1 origin "$BRANCH" \
&& stop_running_app \
+ && migrate_install_dir \
&& git -C "$INSTALL_DIR" checkout --quiet "$BRANCH" \
&& git -C "$INSTALL_DIR" reset --quiet --hard "origin/$BRANCH"; then
ok 'updated existing checkout to latest'
diff --git a/install/installer.py b/install/installer.py
index 793fed0829..2c13fe0c7c 100644
--- a/install/installer.py
+++ b/install/installer.py
@@ -56,8 +56,10 @@ if str(_SOURCE_ROOT) not in sys.path:
from dodaios.core.branding import ( # noqa: E402 - bootstrap source path above
CLI_COMMAND_NAME,
LAUNCHER_ENTRY_NAME,
+ LEGACY_DISTRIBUTION_NAMES,
+ LINUX_APP_NAME,
MACOS_APP_NAME,
- MANAGED_INSTALL_MARKER,
+ MANAGED_INSTALL_MARKERS,
OFFICIAL_REPO_SLUG,
PRODUCT_NAME,
)
@@ -272,8 +274,11 @@ def write_managed_marker(*, with_desktop: bool) -> None:
a manual clone never gets this marker, so neither can be self-reset — this is
the load-bearing safety guard for the whole updater. Best-effort: a marker
failure must never fail the install (it only disables in-app updates).
+
+ The marker is written under its current name and under every earlier one,
+ so an updater from before the rename (a running app that has not restarted
+ yet, or a downgrade) still recognises the checkout.
"""
- marker = repo_root() / MANAGED_INSTALL_MARKER
payload = {
"managed": True,
"install_path": str(repo_root()),
@@ -281,11 +286,18 @@ def write_managed_marker(*, with_desktop: bool) -> None:
"profile": "full" if with_desktop else "headless",
"desktop": with_desktop,
}
- try:
- marker.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
+ text = json.dumps(payload, indent=2) + "\n"
+ written = 0
+ for name in MANAGED_INSTALL_MARKERS:
+ try:
+ (repo_root() / name).write_text(text, encoding="utf-8")
+ written += 1
+ except OSError as exc:
+ note(f"could not write update marker {name} ({exc})")
+ if written:
ok("registered as a managed install (in-app updates enabled)")
- except OSError as exc:
- note(f"could not write update marker ({exc}); in-app updates stay disabled")
+ else:
+ note("in-app updates stay disabled")
def _make_tree_owner_writable(root: Path) -> None:
@@ -363,6 +375,34 @@ def repair_distribution_metadata(
return True
+def _venv_site_packages() -> list[Path]:
+ venv = repo_root() / ".venv"
+ if sys.platform == "win32":
+ return [venv / "Lib" / "site-packages"]
+ return sorted((venv / "lib").glob("python*/site-packages"))
+
+
+def installed_legacy_distributions() -> tuple[str, ...]:
+ """Earlier distribution names this checkout's environment still has installed.
+
+ Read from the metadata on disk, without starting pip: an install made
+ before the rename registered the checkout as ``personal-jarvis``.
+ """
+ found: list[str] = []
+ for name in LEGACY_DISTRIBUTION_NAMES:
+ stem = name.replace("-", "_")
+ patterns = (f"{stem}-*.dist-info", f"{stem}.egg-link", f"{name}.egg-link")
+ for site in _venv_site_packages():
+ try:
+ hit = any(any(site.glob(pattern)) for pattern in patterns)
+ except OSError:
+ hit = False
+ if hit:
+ found.append(name)
+ break
+ return tuple(found)
+
+
def step_pip_install(*, with_desktop: bool, with_voice_local: bool, dry_run: bool) -> None:
from scripts.native_crypto_index import pip_options
@@ -390,7 +430,18 @@ def step_pip_install(*, with_desktop: bool, with_voice_local: bool, dry_run: boo
runtime_step = ("runtime dependencies (cloud-first base)",
pip + ["install", *pip_options(), "-e", "."])
- plans: list[tuple[str, list[str]]] = [
+ plans: list[tuple[str, list[str]]] = []
+ # The checkout used to be installed under the distribution's earlier name.
+ # Both names own the same files, and uninstalling the earlier one AFTER the
+ # current one is installed would delete files the current one needs, so it
+ # goes first. Only the environment's record of it goes: the checkout stays.
+ legacy = installed_legacy_distributions()
+ if legacy:
+ plans.append((
+ f"retire the earlier package name ({', '.join(legacy)})",
+ pip + ["uninstall", "-y", *legacy],
+ ))
+ plans += [
("editable install (entry-points)", pip + ["install", "-e", ".", "--no-deps"]),
runtime_step,
]
@@ -428,8 +479,12 @@ def step_pip_install(*, with_desktop: bool, with_voice_local: bool, dry_run: boo
def is_update_run() -> bool:
- """True when this checkout was already installer-managed (re-run = update)."""
- return (repo_root() / MANAGED_INSTALL_MARKER).exists()
+ """True when this checkout was already installer-managed (re-run = update).
+
+ A marker under any of its names counts: an install made before the rename
+ carries only the earlier one.
+ """
+ return any((repo_root() / name).exists() for name in MANAGED_INSTALL_MARKERS)
def step_models(*, full_profile: bool, dry_run: bool) -> None:
@@ -593,10 +648,35 @@ def _note_stalled_spotlight() -> None:
if (result.stdout or "").strip().splitlines()[-1:] != ["False"]:
return
note("Spotlight on this Mac is not indexing new apps, so search will not find")
- note(f"{LAUNCHER_ENTRY_NAME} yet (Finder › Applications, Launchpad and the Dock do).")
+ note(f"{MACOS_APP_NAME} yet (Finder › Applications, Launchpad and the Dock do).")
note("To repair the macOS search index, run: sudo mdutil -E /")
+def step_macos_bundle_name(*, dry_run: bool) -> None:
+ """Give the macOS app bundle its current name, before anything looks for it.
+
+ The updater of the release before this one starts the app again from the
+ bundle name ``install/update-contract.json`` states, so the bundle must
+ carry that name once this installer is done, with or without the desktop
+ profile. One rename in place, only for this install's own bundle; the
+ privacy grants stay with it (``rename_legacy_macos_app_bundles``).
+ """
+ if sys.platform != "darwin":
+ return
+ if dry_run:
+ console.print("[muted]│ (dry-run) rename the macOS app to its current name[/]")
+ return
+ try:
+ from dodaios.setup.macos_app_bundle import rename_legacy_macos_app_bundles
+
+ renamed = rename_legacy_macos_app_bundles()
+ except Exception as exc: # noqa: BLE001 - the desktop step repairs it again
+ note(f"could not rename the macOS app: {rich_escape(str(exc))}")
+ return
+ for bundle in renamed:
+ ok(f"macOS app renamed to {bundle.name} (its permissions stay)")
+
+
def step_desktop_integration(*, enabled: bool, dry_run: bool) -> bool:
"""Register the managed install with the current desktop shell."""
if not enabled:
@@ -838,10 +918,15 @@ def step_cli_links(*, dry_run: bool) -> None:
``dodaios/setup/cli_path.py``. Never fatal: the app itself works without
the terminal commands, so a failure here is reported and the install goes on.
"""
- from dodaios.setup.cli_path import install_commands
+ from dodaios.setup.cli_path import install_commands, retired_install_roots
try:
- report = install_commands(repo_root(), dry_run=dry_run)
+ # An install moved from its earlier folder name takes that folder's
+ # commands off the Windows Path and puts its own on; elsewhere the
+ # links are pointed at the new folder.
+ report = install_commands(
+ repo_root(), dry_run=dry_run, retired_roots=retired_install_roots(repo_root())
+ )
except Exception as exc: # noqa: BLE001 - terminal commands are optional
note(f"Could not set up the terminal commands: {rich_escape(str(exc))}")
return
@@ -862,6 +947,8 @@ def step_cli_links(*, dry_run: bool) -> None:
note(f"Another {rich_escape(command)} comes first on your PATH: {rich_escape(other)}")
if report.linked:
note(f"Terminal commands ready: {', '.join(report.linked)}")
+ for retired in report.path_retired:
+ note(f"Took the earlier folder {rich_escape(retired)} off your PATH.")
if report.path_updated:
note(f"Added {target} to your PATH ({rich_escape(report.path_updated)}).")
if report.needs_new_terminal:
@@ -882,11 +969,11 @@ def step_summary(*, no_launch: bool, update: bool, headless: bool) -> None:
rows.append(("Start again", f'Windows search -> "{LAUNCHER_ENTRY_NAME}"', "brand"))
elif sys.platform == "darwin":
rows.append(
- ("Start again", f'Launchpad or Spotlight → "{LAUNCHER_ENTRY_NAME}"', "brand")
+ ("Start again", f'Launchpad or Spotlight → "{MACOS_APP_NAME}"', "brand")
)
rows.append(("Permissions", "macOS asks on first launch - approve each prompt", "muted"))
elif sys.platform.startswith("linux") and not (headless or is_headless_linux()):
- rows.append(("Start again", f'app menu -> "{LAUNCHER_ENTRY_NAME}"', "brand"))
+ rows.append(("Start again", f'app menu -> "{LINUX_APP_NAME}"', "brand"))
else:
rows.append(("Start again", ".venv/bin/python -m dodaios.ui.web.launcher", "brand"))
rows.append(("", "(in the install folder)", "muted"))
@@ -1007,6 +1094,7 @@ def main(argv: list[str] | None = None) -> int:
phase("6/6", "Finish & launch")
step_cli_links(dry_run=args.dry_run)
step_worker_cli(dry_run=args.dry_run)
+ step_macos_bundle_name(dry_run=args.dry_run)
if not step_desktop_integration(enabled=with_desktop, dry_run=args.dry_run):
sys.exit(4)
if not step_ui_bundle_check() and not args.dry_run:
diff --git a/install/uninstall.ps1 b/install/uninstall.ps1
index ff0a5d2930..f6c089ffea 100644
--- a/install/uninstall.ps1
+++ b/install/uninstall.ps1
@@ -1,16 +1,18 @@
# Personal Jarvis - Windows uninstaller
#
# Usage (from PowerShell), on a machine where Jarvis is installed:
-# & "$env:USERPROFILE\.personal-jarvis\install\uninstall.ps1"
-# & "$env:USERPROFILE\.personal-jarvis\install\uninstall.ps1" --dry-run # preview
-# & "$env:USERPROFILE\.personal-jarvis\install\uninstall.ps1" --yes # no prompt
+# & "$env:USERPROFILE\.dodaios\install\uninstall.ps1"
+# & "$env:USERPROFILE\.dodaios\install\uninstall.ps1" --dry-run # preview
+# & "$env:USERPROFILE\.dodaios\install\uninstall.ps1" --yes # no prompt
+# (an install never moved from its earlier name lives in ~\.personal-jarvis)
#
# It removes four things a plain folder-delete would miss:
-# 1. the install folder (~\.personal-jarvis)
+# 1. the install folder (~\.dodaios, or ~\.personal-jarvis before the rename;
+# a junction left at the earlier name is removed as a link, never followed)
# 2. the Start-menu launcher and Installed Apps registration
# 3. the login-autostart entry (a logon scheduled task / Startup shortcut)
# 4. the API keys saved in the OS keychain (Windows Credential Manager, service
-# "personal-jarvis")
+# "dodaios", and "personal-jarvis" from before the rename)
#
# Heavy logic lives in `python -m dodaios --uninstall` (cross-platform, tested).
# This bootstrap runs that for the autostart + keys (it asks for confirmation),
@@ -60,13 +62,45 @@ function Stop-JarvisProcesses([string]$Root) {
# Standalone fallback projections of dodaios/core/branding.py. These remain
# available even when a broken venv prevents importing the installed package.
-$DefaultInstallDirName = '.personal-jarvis'
-$WindowsShortcutFileName = 'Personal Jarvis.lnk'
+$DefaultInstallDirName = '.dodaios'
+$LegacyInstallDirName = '.personal-jarvis'
+$WindowsShortcutFileName = 'Dodaios.lnk'
+# Earlier names of the shortcut. Removed only where they start this install.
+$LegacyWindowsShortcutFileNames = @('Personal Jarvis.lnk')
$WindowsUninstallRegistrySubkey = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\PersonalJarvis'
$WindowsAppUserModelId = 'PersonalJarvis.PersonalJarvis'
+# --- uninstall-dir begin (extracted by tests/unit/install/test_install_dir_move.py)
+# The folder a junction or directory symlink at $Path leads to, or $null when
+# $Path is no such link.
+function Get-DirectoryLinkTarget([string]$Path) {
+ try {
+ $Item = Get-Item -LiteralPath $Path -Force -ErrorAction Stop
+ } catch {
+ return $null
+ }
+ if (-not $Item.PSIsContainer -or -not $Item.LinkType) { return $null }
+ $Target = [string](@($Item.Target)[0])
+ if (-not $Target) { return $null }
+ foreach ($Prefix in @('\\?\', '\??\')) {
+ if ($Target.StartsWith($Prefix)) { $Target = $Target.Substring($Prefix.Length) }
+ }
+ if (-not [IO.Path]::IsPathRooted($Target)) {
+ $Target = Join-Path (Split-Path -Parent $Path) $Target
+ }
+ return [IO.Path]::GetFullPath($Target).TrimEnd('\')
+}
+
# DODAIOS_INSTALL_DIR and JARVIS_INSTALL_DIR are one option; the new name wins.
-$InstallDir = if ($env:DODAIOS_INSTALL_DIR) { $env:DODAIOS_INSTALL_DIR } elseif ($env:JARVIS_INSTALL_DIR) { $env:JARVIS_INSTALL_DIR } else { Join-Path $env:USERPROFILE $DefaultInstallDirName }
+# Without either: the folder under its earlier name while that is a real
+# directory (an install that was never moved), else the current one.
+$LegacyInstallDir = Join-Path $env:USERPROFILE $LegacyInstallDirName
+$CurrentInstallDir = Join-Path $env:USERPROFILE $DefaultInstallDirName
+$InstallDir = if ($env:DODAIOS_INSTALL_DIR) { $env:DODAIOS_INSTALL_DIR } elseif ($env:JARVIS_INSTALL_DIR) { $env:JARVIS_INSTALL_DIR } elseif ((Test-Path -LiteralPath $LegacyInstallDir -PathType Container) -and -not (Get-DirectoryLinkTarget $LegacyInstallDir)) { $LegacyInstallDir } else { $CurrentInstallDir }
+# What is deleted is the folder itself, never a link to it.
+$RealInstallDir = Get-DirectoryLinkTarget $InstallDir
+if (-not $RealInstallDir) { $RealInstallDir = [IO.Path]::GetFullPath($InstallDir).TrimEnd('\') }
+# --- uninstall-dir end
$VenvPython = Join-Path $InstallDir '.venv\Scripts\python.exe'
Write-Step 'Uninstall Dodaios'
@@ -95,8 +129,30 @@ if (Test-Path -LiteralPath $VenvPython) {
if ($ans -ne 'yes') { Write-Note 'Cancelled.'; exit 1 }
}
if ($env:APPDATA) {
- $Shortcut = Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs\$WindowsShortcutFileName"
+ $Programs = Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu\Programs'
+ $Shortcut = Join-Path $Programs $WindowsShortcutFileName
Remove-Item -LiteralPath $Shortcut -Force -ErrorAction SilentlyContinue
+ # A shortcut written before the install folder moved names it by the
+ # earlier path, which the link left there leads through: every path
+ # that reaches this install counts.
+ $Prefixes = @($InstallDir, $RealInstallDir)
+ foreach ($Candidate in @($LegacyInstallDir, $CurrentInstallDir)) {
+ if ((Get-DirectoryLinkTarget $Candidate) -eq $RealInstallDir) { $Prefixes += $Candidate }
+ }
+ $Prefixes = @($Prefixes | ForEach-Object { $_.TrimEnd('\') + '\' })
+ foreach ($Legacy in $LegacyWindowsShortcutFileNames) {
+ $LegacyShortcut = Join-Path $Programs $Legacy
+ if (-not (Test-Path -LiteralPath $LegacyShortcut)) { continue }
+ $Target = $null
+ try { $Target = (New-Object -ComObject WScript.Shell).CreateShortcut($LegacyShortcut).TargetPath } catch {}
+ if (-not $Target) { continue }
+ foreach ($Prefix in $Prefixes) {
+ if ($Target.StartsWith($Prefix, [System.StringComparison]::OrdinalIgnoreCase)) {
+ Remove-Item -LiteralPath $LegacyShortcut -Force -ErrorAction SilentlyContinue
+ break
+ }
+ }
+ }
}
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\$WindowsUninstallRegistrySubkey" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -LiteralPath "Registry::HKEY_CURRENT_USER\Software\Classes\AppUserModelId\$WindowsAppUserModelId" -Recurse -Force -ErrorAction SilentlyContinue
@@ -118,25 +174,61 @@ if ($Rc -ne 0) {
# a final failure says plainly WHY instead of a red stacktrace.
if (-not $DryRun) {
Set-Location -LiteralPath $env:USERPROFILE
- Stop-JarvisProcesses $InstallDir
+ # --- uninstall-remove begin (extracted by tests/unit/install/test_install_dir_move.py)
+ # Links that lead to this install from another path: the one given, and
+ # the junction a move to the current folder name left at the earlier name.
+ # Each goes as a link; only the folder they lead to is deleted as a folder.
+ if (Get-DirectoryLinkTarget $RealInstallDir) {
+ Write-Err "$RealInstallDir is itself a link - refusing to delete through it."
+ exit 3
+ }
+ $Links = @()
+ foreach ($Candidate in @($InstallDir, $LegacyInstallDir, $CurrentInstallDir)) {
+ $Target = Get-DirectoryLinkTarget $Candidate
+ if ($Target -and $Target -eq $RealInstallDir -and $Links -notcontains $Candidate) {
+ $Links += $Candidate
+ }
+ }
+ Stop-JarvisProcesses $RealInstallDir
+ foreach ($Link in $Links) {
+ # A process started through the link reports its path through it.
+ Stop-JarvisProcesses $Link
+ try {
+ # Not recursive: this deletes the junction itself, never a file it leads to.
+ [IO.Directory]::Delete($Link, $false)
+ Write-Ok "Removed the link $Link"
+ } catch {
+ Write-Err "Could not remove the link $Link - it holds no files of its own; delete it yourself."
+ }
+ }
$Deleted = $false
for ($Attempt = 1; $Attempt -le 5; $Attempt++) {
try {
- Remove-Item -LiteralPath $InstallDir -Recurse -Force -ErrorAction Stop
+ Remove-Item -LiteralPath $RealInstallDir -Recurse -Force -ErrorAction Stop
$Deleted = $true
break
} catch {
- if (-not (Test-Path -LiteralPath $InstallDir)) { $Deleted = $true; break }
- Stop-JarvisProcesses $InstallDir
+ if (-not (Test-Path -LiteralPath $RealInstallDir)) { $Deleted = $true; break }
+ Stop-JarvisProcesses $RealInstallDir
Start-Sleep -Seconds 2
}
}
- if (-not $Deleted -and (Test-Path -LiteralPath $InstallDir)) {
- Write-Err "Could not fully remove $InstallDir - a program is still using files inside it."
+ if (-not $Deleted -and (Test-Path -LiteralPath $RealInstallDir)) {
+ Write-Err "Could not fully remove $RealInstallDir - a program is still using files inside it."
Write-Note 'Close every Dodaios window (including the tray icon near the clock) and any terminal opened inside that folder, then run this uninstaller again.'
Write-Note 'Signing out of Windows and back in also releases leftover file locks.'
exit 3
}
- Write-Ok "Removed $InstallDir"
+ # A link at either folder name that now leads to the deleted folder under
+ # another spelling of its path (a short 8.3 name) leads nowhere: debris.
+ $RealLeaf = Split-Path -Leaf $RealInstallDir
+ foreach ($Candidate in @($LegacyInstallDir, $CurrentInstallDir)) {
+ $Target = Get-DirectoryLinkTarget $Candidate
+ if (-not $Target -or (Test-Path -LiteralPath $Target)) { continue }
+ if ((Split-Path -Leaf $Target) -ne $RealLeaf) { continue }
+ try { [IO.Directory]::Delete($Candidate, $false) } catch {}
+ }
+ # --- uninstall-remove end
+ Write-Ok "Removed $RealInstallDir"
Write-Step 'Done. Dodaios has been uninstalled.'
}
diff --git a/install/uninstall.sh b/install/uninstall.sh
index 80ef0565da..609aa70993 100644
--- a/install/uninstall.sh
+++ b/install/uninstall.sh
@@ -2,15 +2,18 @@
# Personal Jarvis — macOS / Linux uninstaller
#
# Usage (from any POSIX shell), on a machine where Jarvis is installed:
-# bash ~/.personal-jarvis/install/uninstall.sh
-# bash ~/.personal-jarvis/install/uninstall.sh --dry-run # preview only
-# bash ~/.personal-jarvis/install/uninstall.sh --yes # no prompt
+# bash ~/.dodaios/install/uninstall.sh
+# bash ~/.dodaios/install/uninstall.sh --dry-run # preview only
+# bash ~/.dodaios/install/uninstall.sh --yes # no prompt
+# (an install never moved from its earlier name lives in ~/.personal-jarvis)
#
# It removes four things a plain folder-delete would miss:
-# 1. the install folder (~/.personal-jarvis)
+# 1. the install folder (~/.dodaios, or ~/.personal-jarvis before the rename;
+# a link left at the earlier name is removed as a link, never followed)
# 2. the macOS app bundle or Linux application-menu entry
# 3. the login-autostart entry (~/.config/autostart or ~/Library/LaunchAgents)
-# 4. the API keys saved in the OS keychain (service "personal-jarvis")
+# 4. the API keys saved in the OS keychain (service "dodaios", and
+# "personal-jarvis" from before the rename)
#
# Heavy logic lives in `python -m dodaios --uninstall` (cross-platform, tested).
# This bootstrap runs that for the autostart + keys (it asks for confirmation),
@@ -20,15 +23,31 @@ set -euo pipefail
# Standalone fallback projections of dodaios/core/branding.py. These remain
# available even when a broken venv prevents importing the installed package.
-DEFAULT_INSTALL_DIR_NAME=".personal-jarvis"
-MACOS_APP_DIR_NAME="Personal Jarvis.app"
+DEFAULT_INSTALL_DIR_NAME=".dodaios"
+LEGACY_INSTALL_DIR_NAME=".personal-jarvis"
+MACOS_APP_DIR_NAME="Dodaios.app"
+LEGACY_MACOS_APP_DIR_NAME="Personal Jarvis.app"
MACOS_BUNDLE_ID="com.personal-jarvis.desktop"
MACOS_AUTOSTART_LABEL="com.personal-jarvis.autostart"
-LINUX_DESKTOP_ENTRY_FILE_NAME="personal-jarvis.desktop"
-KEYRING_SERVICE_NAME="personal-jarvis"
+LINUX_DESKTOP_ENTRY_FILE_NAME="dodaios.desktop"
+LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES="personal-jarvis.desktop"
+KEYRING_SERVICE_NAME="dodaios"
+LEGACY_KEYRING_SERVICE_NAMES="personal-jarvis"
+# --- uninstall-dir begin (extracted by tests/unit/install/test_install_dir_move.py)
# DODAIOS_INSTALL_DIR and JARVIS_INSTALL_DIR are one option; the new name wins.
-INSTALL_DIR="${DODAIOS_INSTALL_DIR:-${JARVIS_INSTALL_DIR:-$HOME/$DEFAULT_INSTALL_DIR_NAME}}"
+# Without either: the folder under its earlier name while that is a real
+# directory (an install that was never moved), else the current one.
+INSTALL_DIR="${DODAIOS_INSTALL_DIR:-${JARVIS_INSTALL_DIR:-}}"
+if [ -z "$INSTALL_DIR" ]; then
+ if [ -d "$HOME/$LEGACY_INSTALL_DIR_NAME" ] && [ ! -L "$HOME/$LEGACY_INSTALL_DIR_NAME" ]; then
+ INSTALL_DIR="$HOME/$LEGACY_INSTALL_DIR_NAME"
+ else
+ INSTALL_DIR="$HOME/$DEFAULT_INSTALL_DIR_NAME"
+ fi
+fi
+[ "$INSTALL_DIR" = "/" ] || INSTALL_DIR="${INSTALL_DIR%/}"
+# --- uninstall-dir end
VENV_PYTHON="$INSTALL_DIR/.venv/bin/python"
if [ -t 1 ]; then
@@ -99,6 +118,63 @@ stop_running_instances() {
ok "Stopped the running Dodaios app ($n process(es))."
}
+# Remove the install folder, never through a link. A link (the one given, or
+# the one a move to the current folder name left at the earlier name) is
+# removed as a link, and only when it leads to this install; the folder it
+# leads to is removed as a folder.
+remove_install_dir() {
+ # --- uninstall-remove begin (extracted by tests/unit/install/test_install_dir_move.py)
+ given="$1"
+ real_dir="$(cd -P "$given" 2>/dev/null && pwd -P)" || real_dir="$given"
+ stop_running_instances "$real_dir"
+ [ "$given" = "$real_dir" ] || stop_running_instances "$given"
+ for link in "$given" "$HOME/$LEGACY_INSTALL_DIR_NAME" "$HOME/$DEFAULT_INSTALL_DIR_NAME"; do
+ [ -L "$link" ] || continue
+ link_target="$(cd -P "$link" 2>/dev/null && pwd -P)" || link_target=''
+ [ "$link_target" = "$real_dir" ] || continue
+ # rm on a symlink removes the link itself; it never descends into it.
+ if ! rm -f -- "$link"; then
+ err "Could not remove the link $link."
+ exit 3
+ fi
+ note "removed the link $link"
+ done
+ if [ -L "$real_dir" ] || ! rm -rf -- "$real_dir"; then
+ err "Could not fully remove $real_dir — something is still using files inside it."
+ note 'Close every Dodaios window, then run this uninstaller again.'
+ exit 3
+ fi
+ # --- uninstall-remove end
+}
+
+# Linux, without the venv: the login-autostart entry (current and earlier
+# name) and the application-menu entry under its earlier name. Each one goes
+# only when it starts this install, which its working folder (Path=) tells:
+# an entry of another install on this machine is kept.
+remove_linux_entries_of_install() {
+ # --- uninstall-linux-entries begin (extracted by tests/unit/install/test_linux_entry_rename.py)
+ install_real="$(cd -P "$1" 2>/dev/null && pwd -P)" || install_real="$1"
+ apps_dir="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
+ autostart_dir="${XDG_CONFIG_HOME:-$HOME/.config}/autostart"
+ for entries_dir in "$autostart_dir" "$apps_dir"; do
+ for name in $LINUX_DESKTOP_ENTRY_FILE_NAME $LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES; do
+ entry="$entries_dir/$name"
+ # The current menu entry is this install's by name and goes anyway.
+ [ "$entry" = "$apps_dir/$LINUX_DESKTOP_ENTRY_FILE_NAME" ] && continue
+ [ -f "$entry" ] || continue
+ entry_dir=$(sed -n 's/^Path=//p' "$entry" | head -n 1)
+ entry_real="$(cd -P "$entry_dir" 2>/dev/null && pwd -P)" || entry_real="$entry_dir"
+ if [ -n "$entry_dir" ] && [ "$entry_real" = "$install_real" ]; then
+ rm -f -- "$entry"
+ note "removed $entry"
+ else
+ note "kept $entry (it starts another install)"
+ fi
+ done
+ done
+ # --- uninstall-linux-entries end
+}
+
step 'Uninstall Dodaios'
note "$INSTALL_DIR"
@@ -133,18 +209,21 @@ else
fi
case "$(uname -s)" in
Darwin)
- # Both install locations, but only OUR bundle: the DMG build has
- # the same name and its own bundle id, and is not ours to delete.
+ # Both install locations and both names, but only OUR bundle: the
+ # DMG build has the same name and its own bundle id, and is not
+ # ours to delete.
for apps_dir in "/Applications" "$HOME/Applications"; do
- app="$apps_dir/$MACOS_APP_DIR_NAME"
- [ -e "$app" ] || continue
- app_id=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' \
- "$app/Contents/Info.plist" 2>/dev/null || true)
- if [ -n "$app_id" ] && [ "$app_id" != "$MACOS_BUNDLE_ID" ]; then
- note "kept $app (a separately installed app)"
- continue
- fi
- rm -rf -- "$app"
+ for app_dir_name in "$MACOS_APP_DIR_NAME" "$LEGACY_MACOS_APP_DIR_NAME"; do
+ app="$apps_dir/$app_dir_name"
+ [ -e "$app" ] || continue
+ app_id=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' \
+ "$app/Contents/Info.plist" 2>/dev/null || true)
+ if [ -n "$app_id" ] && [ "$app_id" != "$MACOS_BUNDLE_ID" ]; then
+ note "kept $app (a separately installed app)"
+ continue
+ fi
+ rm -rf -- "$app"
+ done
done
# Without this the login item keeps firing at a deleted app.
agent="$HOME/Library/LaunchAgents/${MACOS_AUTOSTART_LABEL}.plist"
@@ -153,6 +232,7 @@ else
;;
Linux)
rm -f -- "${XDG_DATA_HOME:-$HOME/.local/share}/applications/$LINUX_DESKTOP_ENTRY_FILE_NAME"
+ remove_linux_entries_of_install "$INSTALL_DIR"
;;
esac
ok 'Removed the desktop app registration.'
@@ -178,7 +258,8 @@ elif [ "$RC" -ne 0 ]; then
note 'broken by a system/Homebrew Python upgrade.'
note 'To remove Dodaios anyway:'
note " rm -rf \"$INSTALL_DIR\""
- note "Saved API keys then stay in your OS keychain under \"$KEYRING_SERVICE_NAME\"."
+ note "Saved API keys then stay in your OS keychain under \"$KEYRING_SERVICE_NAME\""
+ note "and \"$LEGACY_KEYRING_SERVICE_NAMES\"."
exit "$RC"
fi
@@ -187,12 +268,7 @@ fi
# fallback path - is caught here again. A failed delete says plainly WHY.
if [ "$DRY_RUN" -eq 0 ]; then
cd "$HOME"
- stop_running_instances "$INSTALL_DIR"
- if ! rm -rf "$INSTALL_DIR"; then
- err "Could not fully remove $INSTALL_DIR — something is still using files inside it."
- note 'Close every Dodaios window, then run this uninstaller again.'
- exit 3
- fi
+ remove_install_dir "$INSTALL_DIR"
ok "Removed $INSTALL_DIR"
step 'Done. Dodaios has been uninstalled.'
fi
diff --git a/install/update-contract.json b/install/update-contract.json
index 8db8135cc1..f355868a88 100644
--- a/install/update-contract.json
+++ b/install/update-contract.json
@@ -4,6 +4,8 @@
"launcher_module": "dodaios.ui.web.launcher",
"version_file": "dodaios/__init__.py",
"config_file": "jarvis.toml",
- "macos_app_dir_name": "Personal Jarvis.app",
- "macos_bundle_id": "com.personal-jarvis.desktop"
+ "config_files": ["jarvis.toml", "dodaios.toml"],
+ "macos_app_dir_name": "Dodaios.app",
+ "macos_bundle_id": "com.personal-jarvis.desktop",
+ "rollback_hook": "dodaios/setup/update_rollback.py"
}
diff --git a/jarvis.spec b/jarvis.spec
index debdd1582b..8859a7122e 100644
--- a/jarvis.spec
+++ b/jarvis.spec
@@ -5,17 +5,19 @@
# allows each DLL to be signed independently.
# - Several executables share ONE Analysis/COLLECT, because a native install
# has to cover both surfaces the project promises:
-# * a windowed GUI launcher (Start Menu / Applications / .desktop), and
+# * a windowed GUI launcher (Start Menu / Applications / .desktop), built a
+# second time under its earlier name `PersonalJarvis`, because taskbar
+# pins, logon tasks and shortcuts of earlier releases name that file, and
# * a console CLI named `dodaios`, so `dodaios serve`, `dodaios --version`,
# `dodaios missions list` behave exactly like the pip console script.
# The same console program is built a second time as `jarvis`, the
# command's earlier name, which scripts and shell history still call.
# All of them run `dodaios/__main__.py`; only the console flag differs.
-# - The GUI binary is `PersonalJarvis`, not `Jarvis`: `Jarvis` and `jarvis`
+# - The GUI binary is `DodaiosApp`, not `Dodaios`: `Dodaios` and `dodaios`
# are the SAME path on Windows (NTFS) and on a default macOS APFS volume, so
-# the second executable would overwrite the first. `PersonalJarvis` is the
-# name dodaios.core.branding already uses for the Windows branded launcher and
-# the macOS bundle executable.
+# the second executable would overwrite the first. `DodaiosApp` is the name
+# dodaios.core.branding uses for the Windows branded launcher and the macOS
+# bundle executable; `PersonalJarvis` is their earlier name.
# - Downloaded ML models are not bundled. The first-run wizard downloads them to
# the platform-specific Jarvis model directory when the user enables them.
# - Optional native voice engines are loaded lazily and degrade to cloud paths
@@ -47,14 +49,26 @@ ICON_DIR = PROJECT_ROOT / "assets" / "icons"
# the release contract address the bundle as `dist/Jarvis/`.
BUNDLE_DIR_NAME = "Jarvis"
# Windowed launcher; see the header note on the case-collision.
-GUI_EXE_NAME = "PersonalJarvis"
+GUI_EXE_NAME = "DodaiosApp"
+# The windowed launcher under its earlier name, built from the same program:
+# a pinned taskbar button, a logon task or a shortcut of an earlier release
+# starts `{app}\PersonalJarvis.exe`, and must keep finding it.
+LEGACY_GUI_EXE_NAMES = ("PersonalJarvis",)
# Console entry point. Same name as the pip console script on purpose.
CLI_EXE_NAME = "dodaios"
# The console entry point under its earlier name, built from the same program.
-# No name here may equal GUI_EXE_NAME ignoring case: they share one folder.
+# No name here may equal a GUI name ignoring case: they share one folder.
LEGACY_CLI_EXE_NAMES = ("jarvis",)
-MACOS_APP_NAME = "Personal Jarvis.app"
+# The Python distribution this tree is installed as, current name first
+# (dodaios.core.branding.DISTRIBUTION_NAMES). An environment set up before the
+# rename still carries the earlier one.
+DISTRIBUTION_NAMES = ('dodaios', 'personal-jarvis')
+
+# The bundle name (``dodaios.core.branding.MACOS_APP_DIR_NAME``). Its bundle id
+# below did not move with it: the privacy grants of every installed copy name
+# that id, and the in-app updater installs a renamed bundle beside the old one.
+MACOS_APP_NAME = "Dodaios.app"
MACOS_BUNDLE_IDENTIFIER = "ai.personaljarvis.desktop"
MACOS_MIN_SYSTEM_VERSION = "12.0"
@@ -104,6 +118,10 @@ datas.append((str(PROJECT_ROOT / "dodaios/agent_runtimes/runtime-versions.json")
# Translated system phrases (dodaios/i18n/catalog.py); without them every
# error and fallback phrase would raise instead of being spoken.
datas.append((str(PROJECT_ROOT / "dodaios/i18n/locales"), "dodaios/i18n/locales"))
+# The data-directory migration engine as a plain file: the runtime hook loads it
+# by path before anything from the package is importable
+# (packaging/pyinstaller_rthook_frozen.py::_load_engine).
+datas.append((str(PROJECT_ROOT / "dodaios/core/identity_migration.py"), "dodaios/core"))
# The local voice engine runs in its OWN Python environment, so a frozen build
# must ship its sources as plain files: setup copies them into the engine home
@@ -123,8 +141,9 @@ if FRONTEND_DIST.exists():
datas.append((str(entry), str(Path("dodaios/ui/web/dist") / rel)))
# Include the default configuration a fresh install is seeded from. The runtime
-# hook copies it to the per-user app directory on first launch; the frozen app
-# never reads or writes the copy inside the bundle.
+# hook copies it to the per-user app directory on first launch (as dodaios.toml
+# when that directory has no jarvis.toml of its own); the frozen app never reads
+# or writes the copy inside the bundle.
datas.append((str(PROJECT_ROOT / "jarvis.toml"), "."))
datas.append((str(PROJECT_ROOT / "docs" / "product"), "docs/product"))
# The onboarding terms and redistribution notices must survive freezing.
@@ -198,8 +217,23 @@ if profiles_dir.exists():
datas.append((str(entry), str(Path("profiles") / rel)))
# Preserve distribution metadata so importlib.metadata can discover the Jarvis
-# entry-point plugins in the frozen layout.
-datas += copy_metadata("personal-jarvis")
+# entry-point plugins in the frozen layout. The build environment holds the
+# tree under one of its distribution names; bundle the first one installed.
+def _installed_distribution() -> str:
+ from importlib import metadata
+
+ for name in DISTRIBUTION_NAMES:
+ try:
+ metadata.distribution(name)
+ except metadata.PackageNotFoundError:
+ continue
+ return name
+ raise SystemExit(
+ f"none of {', '.join(DISTRIBUTION_NAMES)} is installed; run pip install -e . first"
+ )
+
+
+datas += copy_metadata(_installed_distribution())
# Legacy optional data packages are collected only when installed.
for pkg in ("chromadb", "sentence_transformers"):
@@ -396,7 +430,11 @@ if sys.platform == "win32":
StringTable(
"040904B0",
[
- StringStruct("CompanyName", "Personal Jarvis"),
+ StringStruct("CompanyName", "Dodaios"),
+ # TODO(signpath): FileDescription and ProductName keep
+ # the earlier name until the SignPath artifact
+ # configuration pins the new product name
+ # (docs/code-signing-policy.md). Change them together.
StringStruct("FileDescription", "Personal Jarvis"),
StringStruct("FileVersion", VERSION),
StringStruct("InternalName", GUI_EXE_NAME),
@@ -429,29 +467,36 @@ ICON = _icon_path()
# --- Executables ------------------------------------------------------------
-# One COLLECT: the windowed launcher, the console CLI, and the console CLI
-# again under each earlier name.
-
-exe_gui = EXE(
- pyz,
- a.scripts,
- [],
- exclude_binaries=True,
- name=GUI_EXE_NAME,
- debug=False,
- bootloader_ignore_signals=False,
- strip=False,
- upx=False, # UPX commonly triggers antivirus false positives.
- console=False, # Match pythonw behavior without a console window.
- disable_windowed_traceback=False,
- argv_emulation=False,
- target_arch=None,
- codesign_identity=None,
- entitlements_file=None,
- icon=ICON,
- version=version_resource,
- uac_admin=False, # Run asInvoker; elevate only individual actions.
-)
+# One COLLECT: the windowed launcher, the windowed launcher again under each
+# earlier name, the console CLI, and the console CLI again under each earlier
+# name.
+
+def _gui_exe(name):
+ return EXE(
+ pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name=name,
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=False, # UPX commonly triggers antivirus false positives.
+ console=False, # Match pythonw behavior without a console window.
+ disable_windowed_traceback=False,
+ argv_emulation=False,
+ target_arch=None,
+ codesign_identity=None,
+ entitlements_file=None,
+ icon=ICON,
+ version=version_resource,
+ uac_admin=False, # Run asInvoker; elevate only individual actions.
+ )
+
+
+exe_gui = _gui_exe(GUI_EXE_NAME)
+legacy_gui_exes = [_gui_exe(name) for name in LEGACY_GUI_EXE_NAMES]
+
def _console_exe(name):
return EXE(
@@ -481,6 +526,7 @@ legacy_cli_exes = [_console_exe(name) for name in LEGACY_CLI_EXE_NAMES]
coll = COLLECT(
exe_gui,
+ *legacy_gui_exes,
exe_cli,
*legacy_cli_exes,
a.binaries,
@@ -505,8 +551,8 @@ if sys.platform == "darwin":
bundle_identifier=MACOS_BUNDLE_IDENTIFIER,
version=VERSION,
info_plist={
- "CFBundleName": "Personal Jarvis",
- "CFBundleDisplayName": "Personal Jarvis",
+ "CFBundleName": "Dodaios",
+ "CFBundleDisplayName": "Dodaios",
"CFBundleExecutable": GUI_EXE_NAME,
"CFBundleIdentifier": MACOS_BUNDLE_IDENTIFIER,
"CFBundleShortVersionString": VERSION,
diff --git a/packaging/README.md b/packaging/README.md
index 8755471581..a1b47f41e0 100644
--- a/packaging/README.md
+++ b/packaging/README.md
@@ -6,9 +6,9 @@ single build script that produces exactly one release asset.
| OS | Script | Produces |
| ------- | ----------------------------------------------------- | --------------------------------------- |
-| Windows | [`windows/build.ps1`](windows/build.ps1) | `PersonalJarvis-Setup-x64.exe` |
-| macOS | [`macos/build.sh`](macos/build.sh) | `PersonalJarvis-macOS-<arm64\|x64>.dmg` |
-| Linux | [`linux/build.sh`](linux/build.sh) | `PersonalJarvis-Linux-x86_64.AppImage` |
+| Windows | [`windows/build.ps1`](windows/build.ps1) | `PersonalJarvis-Setup-x64.exe` (the name SignPath pins) |
+| macOS | [`macos/build.sh`](macos/build.sh) | `Dodaios-macOS-<arm64\|x64>.dmg` |
+| Linux | [`linux/build.sh`](linux/build.sh) | `Dodaios-Linux-x86_64.AppImage` |
Each script writes into `dist/installers/`, prints the artifact path, and exits
non-zero on any failure. `.github/workflows/desktop-installers.yml` runs these
diff --git a/packaging/linux/AppRun b/packaging/linux/AppRun
index bfe98af664..d723fb8510 100755
--- a/packaging/linux/AppRun
+++ b/packaging/linux/AppRun
@@ -5,7 +5,7 @@
# Two jobs, in this order:
#
# 1. Pass every argument straight through to the frozen executable, so
-# `./PersonalJarvis-Linux-x86_64.AppImage serve`, `--version`, `--doctor`
+# `./Dodaios-Linux-x86_64.AppImage serve`, `--version`, `--doctor`
# and every other CLI invocation behave exactly like the pip-installed
# `jarvis` command. This is the whole reason the AppImage is also the CLI.
#
@@ -33,7 +33,7 @@ else
fi
APP="${HERE}/usr/bin/Jarvis"
-BROWSER_UI_MARKER="${HERE}/usr/share/personal-jarvis/browser-ui"
+BROWSER_UI_MARKER="${HERE}/usr/share/dodaios/browser-ui"
# Default port from dodaios/core/config.py (ui.admin_api_port). A user who
# changed it in jarvis.toml simply gets no auto-opened tab: the probe below
diff --git a/packaging/linux/README.md b/packaging/linux/README.md
index 6e1bc24961..8a72e05778 100644
--- a/packaging/linux/README.md
+++ b/packaging/linux/README.md
@@ -4,12 +4,19 @@
| Artifact | Path | What it is |
|---|---|---|
-| `PersonalJarvis-Linux-x86_64.AppImage` | `dist/installers/` | One executable file. No Python, no pip, no root. Download, `chmod +x`, run. |
-| `personal-jarvis_<version>_amd64.deb` | `dist/installers/` | The same tree as a normal Debian package: `apt install ./personal-jarvis_*.deb` registers the app in the menu and puts `dodaios` on `PATH`. Built only when `dpkg-deb` is present. |
+| `Dodaios-Linux-x86_64.AppImage` (also published as `PersonalJarvis-Linux-x86_64.AppImage`) | `dist/installers/` | One executable file. No Python, no pip, no root. Download, `chmod +x`, run. |
+| `personal-jarvis_<version>_amd64.deb` | `dist/installers/` | The same tree as a normal Debian package named `dodaios`: `apt install ./personal-jarvis_*.deb` registers the app in the menu and puts `dodaios` on `PATH`. Built only when `dpkg-deb` is present. |
Both are produced from one PyInstaller `onedir` freeze and one AppDir, so a bug
can only exist in both or in neither.
+The two file names above are release asset names: the updater and the release
+pipeline look for them, and they keep their earlier spelling until the release
+assets move (with both names published for a transition). Everything a package
+installs on the machine already uses the current name: the Debian package
+`dodaios`, `/opt/Dodaios`, `dodaios.desktop`, the `dodaios` icon and window
+class.
+
## Building
```bash
@@ -89,22 +96,23 @@ does not apply (see above). It lives in `dodaios/ui/desktop_app.py`
command-line tool:
```bash
-chmod +x PersonalJarvis-Linux-x86_64.AppImage
-./PersonalJarvis-Linux-x86_64.AppImage --version
-./PersonalJarvis-Linux-x86_64.AppImage serve # headless API + browser UI
-./PersonalJarvis-Linux-x86_64.AppImage --doctor
+chmod +x Dodaios-Linux-x86_64.AppImage
+./Dodaios-Linux-x86_64.AppImage --version
+./Dodaios-Linux-x86_64.AppImage serve # headless API + browser UI
+./Dodaios-Linux-x86_64.AppImage --doctor
```
To type `dodaios` instead, link it once:
```bash
mkdir -p ~/.local/bin
-ln -sf "$PWD/PersonalJarvis-Linux-x86_64.AppImage" ~/.local/bin/dodaios
+ln -sf "$PWD/Dodaios-Linux-x86_64.AppImage" ~/.local/bin/dodaios
```
The Debian package does this for you: it installs `/usr/bin/dodaios` (the
console entry), `/usr/bin/jarvis` (the same entry under its earlier name) and
-`/usr/bin/personal-jarvis` (the launcher).
+`/usr/bin/personal-jarvis` (the launcher, under the name earlier releases gave
+it), all pointing into `/opt/Dodaios`.
On a host without FUSE - containers, some hardened servers - run the AppImage
with `--appimage-extract-and-run` (or `APPIMAGE_EXTRACT_AND_RUN=1`). That is
@@ -114,7 +122,7 @@ also how the build machine runs `appimagetool` itself.
* **`.deb`** registers the app the normal way: a `.desktop` entry in
`/usr/share/applications`, the icon in the hicolor theme, and the
- commands on `PATH`. `apt remove personal-jarvis` takes all of it away again.
+ commands on `PATH`. `apt remove dodaios` takes all of it away again.
* **AppImage** carries its `.desktop` entry and icon inside itself, which is
what AppImageLauncher and `appimaged` read when they offer to "integrate"
the file. Without one of those tools an AppImage is just a file you run -
@@ -130,11 +138,19 @@ temporary mount that disappears the moment the app exits.
## Updates
The in-app updater replaces the running AppImage in place: it downloads the new
-`PersonalJarvis-Linux-x86_64.AppImage` from the GitHub Release, verifies it
+`Dodaios-Linux-x86_64.AppImage` (or, from an older release, `PersonalJarvis-Linux-x86_64.AppImage`) from the GitHub Release, verifies it
against `installers-SHA256SUMS.txt` from the same release, atomically replaces
the file `$APPIMAGE` points at, restores the executable bit and relaunches.
A `.deb` install updates through the package, not through the app.
+The package was called `personal-jarvis` up to the rename. The current package
+declares `Replaces`, `Conflicts` and `Provides: personal-jarvis`, so installing
+it over the earlier one (`apt install ./personal-jarvis_<version>_amd64.deb`)
+removes that package and its `/opt/PersonalJarvis` tree in the same step, and
+anything that depends on the earlier name stays satisfied. The in-app updater
+is not involved: it only replaces an AppImage, and the AppImage's asset name has
+not changed.
+
## What has actually been tested
Proven in a `python:3.12-bookworm` container on 2026-08-25, against real
diff --git a/packaging/linux/build.sh b/packaging/linux/build.sh
index b9b81f341c..b408a62226 100755
--- a/packaging/linux/build.sh
+++ b/packaging/linux/build.sh
@@ -1,16 +1,22 @@
#!/usr/bin/env bash
#
-# Build the distributable Linux AppImage for Personal Jarvis.
+# Build the distributable Linux AppImage for Dodaios.
#
# packaging/linux/build.sh
#
# Output (per the release contract):
-# dist/installers/PersonalJarvis-Linux-x86_64.AppImage
+# dist/installers/Dodaios-Linux-x86_64.AppImage
# dist/installers/personal-jarvis_<version>_amd64.deb (when dpkg-deb exists)
#
+# The installed names are already the current ones: the Debian package
+# "dodaios" (it replaces the earlier "personal-jarvis" package), /opt/Dodaios,
+# dodaios.desktop and the dodaios icon. A release also publishes the AppImage
+# as PersonalJarvis-Linux-x86_64.AppImage, a byte-identical copy for installs
+# from before the rename (scripts/ci/installer_aliases.py).
+#
# The AppImage is one downloadable file that needs no Python, no pip and no
# system packages: double-click it to run the app, or call it like the CLI
-# ("./PersonalJarvis-Linux-x86_64.AppImage serve"). Both entry points come out
+# ("./Dodaios-Linux-x86_64.AppImage serve"). Both entry points come out
# of the same PyInstaller onedir freeze.
#
# What this AppImage does NOT contain is a native desktop window - read
@@ -41,7 +47,7 @@ FREEZE_DIR="${FREEZE_DIR:-${DIST_DIR}/Jarvis}"
OUT_DIR="${DIST_DIR}/installers"
APPDIR="${DIST_DIR}/AppDir"
FRONTEND_DIST="${REPO_ROOT}/dodaios/ui/web/dist"
-APPIMAGE_PATH="${OUT_DIR}/PersonalJarvis-Linux-x86_64.AppImage"
+APPIMAGE_PATH="${OUT_DIR}/Dodaios-Linux-x86_64.AppImage"
# Pinned build tool. "continuous" is a moving target and an unpinned build tool
# is an unpinned supply chain, so this is an exact release plus its digest; the
@@ -52,10 +58,23 @@ APPIMAGETOOL_SHA256="ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb3
APPIMAGETOOL_CACHE="${DIST_DIR}/.build-tools/appimagetool-${APPIMAGETOOL_VERSION}-x86_64.AppImage"
ICON_SOURCE="${REPO_ROOT}/assets/icons/jarvis-gigi-256.png"
-DESKTOP_FILE_NAME="personal-jarvis.desktop"
+# The desktop entry, its icon and the window class share one name
+# (dodaios/core/branding.py: LINUX_DESKTOP_ENTRY_FILE_NAME, LINUX_WM_CLASS).
+DESKTOP_FILE_NAME="dodaios.desktop"
# The console command and its earlier name; both ship (jarvis.spec builds both).
CLI_EXE_NAMES=("dodaios" "jarvis")
-ICON_FILE_NAME="personal-jarvis.png"
+ICON_FILE_NAME="dodaios.png"
+# usr/share/<name> inside the AppDir; AppRun reads its browser-ui marker there.
+SHARE_DIR_NAME="dodaios"
+# The Debian package. It takes over from the package under its earlier name:
+# Conflicts + Replaces let dpkg remove that package while installing this one,
+# and Provides keeps anything that depends on the earlier name satisfied.
+DEB_PACKAGE_NAME="dodaios"
+LEGACY_DEB_PACKAGE_NAME="personal-jarvis"
+DEB_INSTALL_DIR="/opt/Dodaios"
+# The earlier command that opens the app; kept so a launcher, a script or a
+# habit that calls it keeps working.
+LEGACY_APP_COMMAND_NAME="personal-jarvis"
log() { printf '[linux-build] %s\n' "$*"; }
die() { printf '[linux-build] ERROR: %s\n' "$*" >&2; exit 1; }
@@ -132,11 +151,12 @@ else
)
fi
-# The windowed target is named PersonalJarvis in jarvis.spec, because `Jarvis`
-# and `jarvis` are the SAME path on Windows and on a default macOS volume and
+# The windowed target is named DodaiosApp in jarvis.spec, because `Dodaios`
+# and `dodaios` are the SAME path on Windows and on a default macOS volume and
# the second executable would overwrite the first. Linux has no such problem,
-# but the freeze is shared, so accept either name rather than pinning one.
-GUI_EXE_CANDIDATES=("PersonalJarvis" "Jarvis")
+# but the freeze is shared, so accept the earlier names too rather than pinning
+# one. The freeze also ships the launcher under its earlier name PersonalJarvis.
+GUI_EXE_CANDIDATES=("DodaiosApp" "PersonalJarvis" "Jarvis")
GUI_EXE_NAME=""
if building; then
for candidate in "${GUI_EXE_CANDIDATES[@]}"; do
@@ -149,7 +169,7 @@ if building; then
|| die "PyInstaller produced none of ${GUI_EXE_CANDIDATES[*]} in '${FREEZE_DIR}' - jarvis.spec has no windowed EXE target"
log "windowed executable: ${GUI_EXE_NAME}"
else
- GUI_EXE_NAME="PersonalJarvis"
+ GUI_EXE_NAME="${GUI_EXE_CANDIDATES[0]}"
fi
# --- 3. AppDir --------------------------------------------------------------
@@ -159,7 +179,7 @@ run rm -rf "${APPDIR}"
run mkdir -p "${APPDIR}/usr/bin" \
"${APPDIR}/usr/share/applications" \
"${APPDIR}/usr/share/icons/hicolor/256x256/apps" \
- "${APPDIR}/usr/share/personal-jarvis"
+ "${APPDIR}/usr/share/${SHARE_DIR_NAME}"
if building; then
# The whole onedir tree lands in usr/bin so PyInstaller's "_internal next to
@@ -190,7 +210,8 @@ else
fi
run "${PYTHON}" "${SCRIPT_DIR}/make_desktop_entry.py" \
- "${APPDIR}/usr/share/applications/${DESKTOP_FILE_NAME}" --exec Jarvis
+ "${APPDIR}/usr/share/applications/${DESKTOP_FILE_NAME}" --exec Jarvis \
+ --icon "${ICON_FILE_NAME%.png}"
[ -f "${ICON_SOURCE}" ] || die "icon master missing: ${ICON_SOURCE}"
run cp "${ICON_SOURCE}" "${APPDIR}/usr/share/icons/hicolor/256x256/apps/${ICON_FILE_NAME}"
@@ -211,12 +232,12 @@ run chmod +x "${APPDIR}/AppRun"
# opening the extra tab on its own, with no second place to remember.
if building && [ -d "${APPDIR}/usr/bin/_internal/gi" ]; then
log "freeze contains PyGObject - native window backend available, no browser hand-off"
- run rm -f "${APPDIR}/usr/share/personal-jarvis/browser-ui"
+ run rm -f "${APPDIR}/usr/share/${SHARE_DIR_NAME}/browser-ui"
else
log "freeze has no PyGObject - the app will serve its interface over HTTP and AppRun opens it in the default browser"
if building; then
printf '%s\n' "This build has no bundled GTK/WebKit window backend; AppRun opens the UI in the default browser." \
- > "${APPDIR}/usr/share/personal-jarvis/browser-ui"
+ > "${APPDIR}/usr/share/${SHARE_DIR_NAME}/browser-ui"
fi
fi
@@ -275,26 +296,31 @@ elif ! command -v dpkg-deb >/dev/null 2>&1; then
else
VERSION="$("${PYTHON}" -c "import sys; sys.path.insert(0, '${REPO_ROOT}'); import dodaios; print(dodaios.__version__)")"
DEB_ROOT="${DIST_DIR}/deb-root"
+ # The release asset keeps its earlier file name (see the header); the
+ # package inside it is DEB_PACKAGE_NAME.
DEB_PATH="${OUT_DIR}/personal-jarvis_${VERSION}_amd64.deb"
log "building ${DEB_PATH}"
run rm -rf "${DEB_ROOT}"
run mkdir -p "${DEB_ROOT}/DEBIAN" \
- "${DEB_ROOT}/opt/PersonalJarvis" \
+ "${DEB_ROOT}${DEB_INSTALL_DIR}" \
"${DEB_ROOT}/usr/bin" \
"${DEB_ROOT}/usr/share/applications" \
"${DEB_ROOT}/usr/share/icons/hicolor/256x256/apps"
if building; then
# The very same AppDir: one tree, two package formats, so a bug can only
# exist in both or in neither.
- cp -a "${APPDIR}/." "${DEB_ROOT}/opt/PersonalJarvis/"
+ cp -a "${APPDIR}/." "${DEB_ROOT}${DEB_INSTALL_DIR}/"
cat > "${DEB_ROOT}/DEBIAN/control" <<EOF
-Package: personal-jarvis
+Package: ${DEB_PACKAGE_NAME}
Version: ${VERSION}
Section: utils
Priority: optional
Architecture: amd64
Depends: libc6
Recommends: libportaudio2
+Replaces: ${LEGACY_DEB_PACKAGE_NAME}
+Conflicts: ${LEGACY_DEB_PACKAGE_NAME}
+Provides: ${LEGACY_DEB_PACKAGE_NAME}
Maintainer: Dodaios contributors <https://github.com/Dodaios/Dodaios>
Description: AI agent for your computer
Dodaios coordinates desktop apps, tools, models and specialized
@@ -302,14 +328,14 @@ Description: AI agent for your computer
system Python and no pip installation.
EOF
for cli_name in "${CLI_EXE_NAMES[@]}"; do
- ln -sf "/opt/PersonalJarvis/usr/bin/${cli_name}" "${DEB_ROOT}/usr/bin/${cli_name}"
+ ln -sf "${DEB_INSTALL_DIR}/usr/bin/${cli_name}" "${DEB_ROOT}/usr/bin/${cli_name}"
done
- ln -sf /opt/PersonalJarvis/AppRun "${DEB_ROOT}/usr/bin/personal-jarvis"
+ ln -sf "${DEB_INSTALL_DIR}/AppRun" "${DEB_ROOT}/usr/bin/${LEGACY_APP_COMMAND_NAME}"
cp "${ICON_SOURCE}" "${DEB_ROOT}/usr/share/icons/hicolor/256x256/apps/${ICON_FILE_NAME}"
fi
run "${PYTHON}" "${SCRIPT_DIR}/make_desktop_entry.py" \
"${DEB_ROOT}/usr/share/applications/${DESKTOP_FILE_NAME}" \
- --exec /opt/PersonalJarvis/AppRun
+ --exec "${DEB_INSTALL_DIR}/AppRun" --icon "${ICON_FILE_NAME%.png}"
run dpkg-deb --build --root-owner-group "${DEB_ROOT}" "${DEB_PATH}"
run rm -rf "${DEB_ROOT}"
fi
diff --git a/packaging/linux/make_desktop_entry.py b/packaging/linux/make_desktop_entry.py
index 5d8a579866..8ebba801c2 100644
--- a/packaging/linux/make_desktop_entry.py
+++ b/packaging/linux/make_desktop_entry.py
@@ -36,7 +36,6 @@ from dodaios import __version__ # noqa: E402 - needs REPO_ROOT on sys.path fir
from dodaios.core.branding import ( # noqa: E402
LINUX_APP_NAME,
LINUX_WM_CLASS,
- PRODUCT_SLUG,
)
from dodaios.core.desktop_entry import escape_value, exec_value # noqa: E402
@@ -47,13 +46,20 @@ COMMENT = "Turn your computer into an AI agent"
#: registers; changing it would move the app in the menu between install kinds.
CATEGORIES = "Utility;"
-#: The app search matches Name, and only some shells also match Comment. The
-#: product name is two words, so somebody typing the half they remember needs
+#: The app search matches Name, and only some shells also match Comment.
+#: Somebody typing the name they remember from earlier releases ("jarvis") needs
#: these keywords to find it at all.
KEYWORDS = "jarvis;assistant;voice;agent;automation;"
-def render(exec_name: str = "Jarvis", icon_name: str = PRODUCT_SLUG) -> str:
+#: The icon's theme name: the AppImage and the Debian package install the PNG
+#: as ``<ICON_NAME>.png`` (``packaging/linux/build.sh``, ``ICON_FILE_NAME``).
+#: It follows the window class, so the entry, its icon and the window share
+#: one name.
+ICON_NAME = LINUX_WM_CLASS
+
+
+def render(exec_name: str = "Jarvis", icon_name: str = ICON_NAME) -> str:
"""Return the full Desktop Entry text for the AppImage."""
return (
@@ -89,8 +95,8 @@ def main(argv: list[str] | None = None) -> int:
parser.add_argument(
"--icon",
dest="icon_name",
- default=PRODUCT_SLUG,
- help=f"Icon name without extension (default: {PRODUCT_SLUG})",
+ default=ICON_NAME,
+ help=f"Icon name without extension (default: {ICON_NAME})",
)
args = parser.parse_args(argv)
diff --git a/packaging/macos/README.md b/packaging/macos/README.md
index 6a9ef1b516..71edcde597 100644
--- a/packaging/macos/README.md
+++ b/packaging/macos/README.md
@@ -5,10 +5,10 @@ family:
| Runner | Artifact |
|---|---|
-| Apple Silicon (`macos-15`) | `dist/installers/PersonalJarvis-macOS-arm64.dmg` |
-| Intel (`macos-15-intel`) | `dist/installers/PersonalJarvis-macOS-x64.dmg` |
+| Apple Silicon (`macos-15`) | `dist/installers/Dodaios-macOS-arm64.dmg` |
+| Intel (`macos-15-intel`) | `dist/installers/Dodaios-macOS-x64.dmg` |
-The image contains `Personal Jarvis.app` next to a symlink to `/Applications`:
+The image contains `Dodaios.app` next to a symlink to `/Applications`:
open it, drag the app across, done. The app is a PyInstaller `BUNDLE` built
from `jarvis.spec`; its icon is `assets/icons/jarvis.icns`, regenerated by
`packaging/macos/make_icns.py`.
@@ -19,7 +19,7 @@ from `jarvis.spec`; its icon is `assets/icons/jarvis.icns`, regenerated by
python3 -m pip install -e ".[full]"
python3 -m pip install pyinstaller
bash packaging/macos/build.sh
-python3 scripts/ci/check_frozen_macos_app.py --app "dist/Personal Jarvis.app"
+python3 scripts/ci/check_frozen_macos_app.py --app "dist/Dodaios.app"
```
`DRY_RUN=1` prints every command it would run without running any of them,
@@ -74,7 +74,7 @@ The same file carries the German and Spanish versions. Both bundles declare
`Info.plist` (the spec spreads `localization_plist_keys()` into its dict) and carry
`Contents/Resources/{de,es}.lproj/InfoPlist.strings`. English stays the base text in
`Info.plist`, so there is no `en.lproj`. For this `.dmg` app, `build.sh` runs
-`packaging/macos/add_localizations.py --app "dist/Personal Jarvis.app"` on the
+`packaging/macos/add_localizations.py --app "dist/Dodaios.app"` on the
finished bundle BEFORE signing, because the `.lproj` files are part of the code seal:
one added after `codesign` would invalidate the signature and the notarization. The
managed bundle writes the same files itself when it lays out the app. The format
@@ -179,7 +179,7 @@ That build is fine for local testing and must not be published.
shortcut for unsigned apps in Sequoia, so do not hand it to a user without
asking which version they are on.
- Either way, `xattr -dr com.apple.quarantine "/Applications/Personal Jarvis.app"`
+ Either way, `xattr -dr com.apple.quarantine "/Applications/Dodaios.app"`
does the same thing from a terminal on every version.
These steps follow Apple's published behaviour and have not been tried on a
@@ -270,21 +270,21 @@ alone.
## Reaching the CLI
The bundle ships the console entry at
-`Personal Jarvis.app/Contents/MacOS/dodaios`. It is the same program as the
+`Dodaios.app/Contents/MacOS/dodaios`. It is the same program as the
pip-installed `dodaios` command:
```bash
-"/Applications/Personal Jarvis.app/Contents/MacOS/dodaios" --version
-"/Applications/Personal Jarvis.app/Contents/MacOS/dodaios" serve
+"/Applications/Dodaios.app/Contents/MacOS/dodaios" --version
+"/Applications/Dodaios.app/Contents/MacOS/dodaios" serve
```
To type plain `dodaios`, link it once:
```bash
-sudo ln -sf "/Applications/Personal Jarvis.app/Contents/MacOS/dodaios" /usr/local/bin/dodaios
+sudo ln -sf "/Applications/Dodaios.app/Contents/MacOS/dodaios" /usr/local/bin/dodaios
# or, without sudo, if ~/.local/bin is on your PATH:
mkdir -p ~/.local/bin
-ln -sf "/Applications/Personal Jarvis.app/Contents/MacOS/dodaios" ~/.local/bin/dodaios
+ln -sf "/Applications/Dodaios.app/Contents/MacOS/dodaios" ~/.local/bin/dodaios
```
`Contents/MacOS/jarvis` is the same entry under the command's earlier name; a
@@ -300,7 +300,7 @@ and a launch from outside it is a different identity with no grants.
The in-app updater downloads the `.dmg` for this Mac's architecture from the
GitHub Release, verifies it against `installers-SHA256SUMS.txt` from the same
release, mounts it with `hdiutil attach`, replaces the running
-`Personal Jarvis.app` atomically, detaches the image and relaunches with
+`Dodaios.app` atomically, detaches the image and relaunches with
`open`. Whether the privacy grants the user already gave survive the update
depends on the signature, not on the bundle identifier alone: with a Developer
ID signature the identity (bundle id plus Team ID) is the same in every version
diff --git a/packaging/macos/add_localizations.py b/packaging/macos/add_localizations.py
index 04607aec33..5647454888 100644
--- a/packaging/macos/add_localizations.py
+++ b/packaging/macos/add_localizations.py
@@ -1,4 +1,4 @@
-"""Write the translated ``InfoPlist.strings`` into a built ``Personal Jarvis.app``.
+"""Write the translated ``InfoPlist.strings`` into a built ``Dodaios.app``.
PyInstaller's ``BUNDLE`` writes the base (English) ``Info.plist`` and, through
``jarvis.spec``, the ``CFBundleLocalizations`` key. The per-language strings that
@@ -13,7 +13,7 @@ importable on the build machine). The managed source-install app writes the same
files itself (``dodaios.setup.macos_app_bundle``), so both bundles show the same
sentences.
- python packaging/macos/add_localizations.py --app "dist/Personal Jarvis.app"
+ python packaging/macos/add_localizations.py --app "dist/Dodaios.app"
Exit codes: 0 = written, 1 = the app bundle is not usable (no ``Contents`` folder).
"""
@@ -50,7 +50,7 @@ def add_localizations(app: Path) -> list[Path]:
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
- parser.add_argument("--app", required=True, type=Path, help="the built Personal Jarvis.app")
+ parser.add_argument("--app", required=True, type=Path, help="the built Dodaios.app")
args = parser.parse_args(argv)
try:
written = add_localizations(args.app)
diff --git a/packaging/macos/build.sh b/packaging/macos/build.sh
index 17d13e506e..84991b0a38 100755
--- a/packaging/macos/build.sh
+++ b/packaging/macos/build.sh
@@ -1,14 +1,18 @@
#!/usr/bin/env bash
#
-# Build the distributable macOS disk image for Personal Jarvis.
+# Build the distributable macOS disk image for Dodaios.
#
# packaging/macos/build.sh
#
# Output (per the release contract):
-# dist/installers/PersonalJarvis-macOS-arm64.dmg on Apple Silicon
-# dist/installers/PersonalJarvis-macOS-x64.dmg on Intel
+# dist/installers/Dodaios-macOS-arm64.dmg on Apple Silicon
+# dist/installers/Dodaios-macOS-x64.dmg on Intel
#
-# The disk image contains "Personal Jarvis.app" next to a symlink to
+# A release also publishes each image as PersonalJarvis-macOS-<arch>.dmg, a
+# byte-identical copy for installs from before the rename
+# (scripts/ci/installer_aliases.py).
+#
+# The disk image contains "Dodaios.app" next to a symlink to
# /Applications, which is the drag-to-install layout every Mac user already
# knows. The app is a PyInstaller BUNDLE built from jarvis.spec.
#
@@ -46,8 +50,8 @@ DRY_RUN="${DRY_RUN:-0}"
PYTHON="${PYTHON:-python3}"
SKIP_FRONTEND="${SKIP_FRONTEND:-0}"
-APP_NAME="Personal Jarvis"
-VOLUME_NAME="Personal Jarvis"
+APP_NAME="Dodaios"
+VOLUME_NAME="Dodaios"
DIST_DIR="${REPO_ROOT}/dist"
APP_BUNDLE="${DIST_DIR}/${APP_NAME}.app"
OUT_DIR="${DIST_DIR}/installers"
@@ -89,7 +93,7 @@ case "${MACHINE}" in
x86_64) ARCH_TAG="x64" ;;
*) die "unsupported macOS architecture: ${MACHINE}" ;;
esac
-DMG_PATH="${OUT_DIR}/PersonalJarvis-macOS-${ARCH_TAG}.dmg"
+DMG_PATH="${OUT_DIR}/Dodaios-macOS-${ARCH_TAG}.dmg"
log "host ${MACHINE} -> building ${ARCH_TAG}"
# A half-configured certificate is a mistake worth hearing about before the
@@ -383,7 +387,7 @@ if [ "${SIGNED_FOR_DISTRIBUTION}" = "1" ] && notary_credentials_present; then
# stapled INTO the bundle. A ticket stapled only to the .dmg disappears the
# moment the user drags the app out of it, which is the one thing every user
# does - the app would then need a network round trip on first launch.
- ZIP_PATH="${DIST_DIR}/PersonalJarvis-macOS-${ARCH_TAG}-notarize.zip"
+ ZIP_PATH="${DIST_DIR}/Dodaios-macOS-${ARCH_TAG}-notarize.zip"
run rm -f "${ZIP_PATH}"
run ditto -c -k --keepParent "${APP_BUNDLE}" "${ZIP_PATH}"
notarize "${ZIP_PATH}"
diff --git a/packaging/pyinstaller_rthook_frozen.py b/packaging/pyinstaller_rthook_frozen.py
index ed8ee1c342..63820ef635 100644
--- a/packaging/pyinstaller_rthook_frozen.py
+++ b/packaging/pyinstaller_rthook_frozen.py
@@ -27,6 +27,18 @@ maintainer can still run a frozen build against a scratch directory. So does
copy of ``dodaios.core.env_prefix._adopt`` (``tests/unit/core/test_env_prefix.py``
holds the copy identical).
+The per-user directory had an earlier name (``%LOCALAPPDATA%\\Jarvis``,
+``~/.jarvis``). While a real directory stands under that name it stays in use.
+The desktop app itself (the GUI executable, default instance, no other
+instance running) first moves it to the current name with one rename and
+leaves a junction or symlink behind. The engine that does it,
+``dodaios/core/identity_migration.py``, is shipped by ``jarvis.spec`` as a plain
+file so this hook can load it by path. Helpers and the console CLI only
+resolve. When the engine cannot be loaded, the hook resolves with an inline
+copy of the rule and moves nothing. The config file is never renamed: an
+existing ``jarvis.toml`` stays the configuration, a new install gets
+``dodaios.toml``.
+
Standard library only, and no ``jarvis`` import: a failure in a runtime hook
kills a windowed process before any logging exists. ``tests/unit/packaging/
test_frozen_runtime_hook.py`` pins the directory convention below to
@@ -40,10 +52,38 @@ import shutil
import sys
from pathlib import Path
-# Mirrors dodaios.core.branding.WINDOWS_USER_DATA_DIR_NAME / FALLBACK_USER_DATA_DIR_NAME.
-_WINDOWS_USER_DATA_DIR_NAME = "Jarvis"
-_FALLBACK_USER_DATA_DIR_NAME = ".jarvis"
-_CONFIG_FILE_NAME = "jarvis.toml"
+# Mirror dodaios.core.branding (tests/unit/core/test_identity_single_source.py).
+_WINDOWS_USER_DATA_DIR_NAME = "Dodaios"
+_LEGACY_WINDOWS_USER_DATA_DIR_NAMES = ("Jarvis",)
+_FALLBACK_USER_DATA_DIR_NAME = ".dodaios-data"
+_LEGACY_FALLBACK_USER_DATA_DIR_NAMES = (".jarvis",)
+_CONFIG_FILE_NAME = "dodaios.toml"
+_LEGACY_CONFIG_FILE_NAMES = ("jarvis.toml",)
+# The executables that are the desktop app itself (jarvis.spec GUI_EXE_NAME and
+# LEGACY_GUI_EXE_NAMES). Only one of them migrates the data directory.
+_GUI_EXE_NAMES = ("DodaiosApp", "PersonalJarvis")
+# Single-instance mutexes of a running desktop app, every instance and every
+# name (dodaios.core.identity_boot.primary_mutex_names).
+_MUTEX_NAMES = (
+ "Global\\Dodaios_v1",
+ "Global\\Dodaios_v1_dev",
+ "Global\\PersonalJarvis_v1",
+ "Global\\PersonalJarvis_v1_dev",
+)
+# Lock files a running primary holds in the data directory
+# (dodaios.core.identity_boot.PRIMARY_LOCK_FILES).
+_PRIMARY_LOCK_FILES = ("instance.lock", os.path.join("data", "jarvis.lock"))
+# The name the bundle ships its default configuration under (jarvis.spec).
+_BUNDLED_CONFIG_FILE_NAME = "jarvis.toml"
+# Where jarvis.spec puts the migration engine inside the bundle.
+_ENGINE_PATH = ("dodaios", "core", "identity_migration.py")
+_MIGRATION_WAIT_SECONDS = 2.0
+# Carries the hook's one-line migration report to the launcher, which logs it
+# once a log sink exists (dodaios.core.identity_boot.HOOK_REPORT_ENV_VAR).
+_REPORT_ENV_VAR = "JARVIS_IDENTITY_MIGRATION_REPORT"
+# Outcomes of dodaios.core.identity_migration.DirectoryOutcome, by value.
+_QUIET_OUTCOMES = ("nothing_to_migrate", "already_linked")
+_MOVED_OUTCOMES = ("migrated", "link_restored")
# Mirrors dodaios.core.env_prefix: the prefixes and the adoption itself.
_PREFIXES = (("DODAIOS_", "JARVIS_"), ("DODAIOSCTL_", "JARVISCTL_"))
@@ -67,12 +107,177 @@ def _adopt(environ):
return clashes
-def _user_data_dir() -> Path:
- """``%LOCALAPPDATA%\\Jarvis`` on Windows, ``~/.jarvis`` everywhere else."""
+def _load_engine():
+ """The migration engine, loaded by file path; ``None`` when it cannot be loaded."""
+ import importlib.util
+
+ candidates = []
+ meipass = getattr(sys, "_MEIPASS", None)
+ if meipass:
+ candidates.append(Path(meipass).joinpath(*_ENGINE_PATH))
+ # A checkout, where packaging/ sits beside dodaios/.
+ candidates.append(Path(__file__).resolve().parent.parent.joinpath(*_ENGINE_PATH))
+ name = "_dodaios_frozen_identity_migration"
+ for path in candidates:
+ if not path.is_file():
+ continue
+ try:
+ spec = importlib.util.spec_from_file_location(name, path)
+ if spec is None or spec.loader is None:
+ continue
+ module = importlib.util.module_from_spec(spec)
+ sys.modules[name] = module
+ spec.loader.exec_module(module)
+ except Exception as exc: # noqa: BLE001 - any failure falls back to the inline rule
+ sys.modules.pop(name, None)
+ _warn(f"could not load the migration engine from {path}: {exc}")
+ continue
+ return module
+ return None
+
+
+def _user_data_dir_pair():
+ """``(current, legacy paths)`` of the per-user directory, as in dodaios.core.identity_boot."""
base = os.environ.get("LOCALAPPDATA")
if base:
- return Path(base) / _WINDOWS_USER_DATA_DIR_NAME
- return Path.home() / _FALLBACK_USER_DATA_DIR_NAME
+ parent = Path(base)
+ name, legacy = _WINDOWS_USER_DATA_DIR_NAME, _LEGACY_WINDOWS_USER_DATA_DIR_NAMES
+ else:
+ parent = Path.home()
+ name, legacy = _FALLBACK_USER_DATA_DIR_NAME, _LEGACY_FALLBACK_USER_DATA_DIR_NAMES
+ return parent / name, tuple(parent / old for old in legacy)
+
+
+def _legacy_wins(legacy: Path, current: Path) -> bool:
+ """The engine's rule without the engine: a legacy real directory stays in use."""
+ import stat
+
+ try:
+ metadata = os.lstat(legacy)
+ except (FileNotFoundError, NotADirectoryError):
+ return False
+ except OSError:
+ # Cannot be inspected: never taken for absent.
+ return True
+ reparse = getattr(metadata, "st_file_attributes", 0) & 0x400
+ is_link = stat.S_ISLNK(metadata.st_mode) or bool(
+ reparse and getattr(metadata, "st_reparse_tag", 0) in (0xA0000003, 0xA000000C)
+ )
+ if not is_link:
+ return stat.S_ISDIR(metadata.st_mode)
+ if not os.path.isdir(legacy):
+ return False
+ try:
+ return not os.path.samefile(legacy, current)
+ except OSError:
+ # The current directory does not exist, so the link leads elsewhere.
+ return True
+
+
+def _resolve_home(engine) -> Path:
+ current, legacy = _user_data_dir_pair()
+ if engine is not None:
+ try:
+ return Path(engine.resolve_directory(current, legacy))
+ except Exception as exc: # noqa: BLE001 - falls back to the inline rule
+ _warn(f"could not resolve the data directory with the engine: {exc}")
+ for old in legacy:
+ if _legacy_wins(old, current):
+ return old
+ return current
+
+
+def _user_data_dir() -> Path:
+ """``%LOCALAPPDATA%\\Dodaios`` on Windows, ``~/.dodaios-data`` everywhere else.
+
+ The directory under its earlier name while that is still a real directory.
+ """
+ return _resolve_home(_load_engine())
+
+
+def _resolve_config_file(home: Path) -> Path:
+ """A legacy-named config file while it exists, else the current name. Never renamed."""
+ for legacy in _LEGACY_CONFIG_FILE_NAMES:
+ candidate = home / legacy
+ if candidate.is_file():
+ return candidate
+ return home / _CONFIG_FILE_NAME
+
+
+def _is_main_instance(engine, legacy_dirs) -> bool:
+ """The desktop app, default instance, locked, and no other instance running."""
+ executable = Path(sys.executable).stem.casefold()
+ if executable not in {name.casefold() for name in _GUI_EXE_NAMES}:
+ return False
+ if (os.environ.get("JARVIS_INSTANCE") or "").strip().lower() not in ("", "default"):
+ return False
+ if "--no-lock" in sys.argv[1:]:
+ return False
+ if sys.platform == "win32":
+ return not engine.named_mutex_exists(_MUTEX_NAMES)
+ locks = [old / name for old in legacy_dirs for name in _PRIMARY_LOCK_FILES]
+ return not engine.lock_file_held(locks)
+
+
+def _migrate(engine) -> None:
+ """Move the legacy data directory when this is the main instance. Never raises."""
+ if engine is None:
+ return
+ current, legacy = _user_data_dir_pair()
+ try:
+ # The ordinary start: nothing under an earlier name and no unfinished
+ # move on record. Two stat calls, and no instance probe at all.
+ pending = os.path.lexists(engine.default_lock_path(current)) or any(
+ engine.inspect_legacy(old, current) is engine.LegacyState.REAL_DIRECTORY
+ for old in legacy
+ )
+ if not pending or not _is_main_instance(engine, legacy):
+ return
+ results = [
+ engine.migrate_directory(old, current, wait_seconds=_MIGRATION_WAIT_SECONDS)
+ for old in legacy
+ ]
+ except Exception as exc: # noqa: BLE001 - boot continues where the data is; reported
+ _report("WARNING", f"Data directory migration failed ({type(exc).__name__}: {exc}).")
+ return
+ notable = [r for r in results if r.outcome.value not in _QUIET_OUTCOMES]
+ if not notable:
+ return
+ moved = all(r.outcome.value in _MOVED_OUTCOMES for r in notable)
+ text = "; ".join(
+ f"{r.legacy} -> {r.current}: {r.outcome.value}, using {r.effective}"
+ + (f" ({r.detail})" if r.detail else "")
+ for r in notable
+ )
+ _report("INFO" if moved else "WARNING", f"Data directory migration: {text}")
+
+
+def _report(level: str, message: str) -> None:
+ """Hand the line on to the launcher's log, which does not exist yet, and to stderr."""
+ _warn(message)
+ try:
+ os.environ[_REPORT_ENV_VAR] = f"{level}|{message}"
+ except (OSError, ValueError) as exc:
+ _warn(f"could not pass the migration report on: {exc}")
+
+
+def _names_legacy_default(name: str, legacy_dirs, leaf_names) -> bool:
+ """True when variable ``name`` holds what this hook exports for a legacy directory.
+
+ An app started by an earlier one (an in-app restart, an update) inherits
+ the variables that process's hook exported. A value that only names a
+ legacy directory's own default location is derived afresh, so the app
+ does not keep the old spelling once the directory has moved.
+ """
+ value = (os.environ.get(name) or "").strip()
+ if not value:
+ return False
+ wanted = os.path.normcase(os.path.normpath(value))
+ return any(
+ wanted == os.path.normcase(os.path.normpath(str(old / leaf)))
+ for old in legacy_dirs
+ for leaf in leaf_names
+ )
def _is_set(name: str) -> bool:
@@ -109,12 +314,22 @@ def _apply() -> None:
for new_name in clashes:
_warn(f"{new_name} and its JARVIS_ spelling are set to different values; using {new_name}.")
- home = _user_data_dir()
- config_path = home / _CONFIG_FILE_NAME
+ engine = _load_engine()
+ _migrate(engine)
+ home = _resolve_home(engine)
+ _current, legacy_dirs = _user_data_dir_pair()
+ moved_away = [old for old in legacy_dirs if old != home]
+ config_names = (*_LEGACY_CONFIG_FILE_NAMES, _CONFIG_FILE_NAME)
+ if _names_legacy_default("JARVIS_CONFIG", moved_away, config_names):
+ os.environ.pop("JARVIS_CONFIG", None)
+ if _names_legacy_default("JARVIS_DATA_DIR", moved_away, ("data",)):
+ os.environ.pop("JARVIS_DATA_DIR", None)
+
+ config_path = _resolve_config_file(home)
if not _is_set("JARVIS_CONFIG"):
if not config_path.exists():
- bundled = Path(sys._MEIPASS) / _CONFIG_FILE_NAME # noqa: SLF001
+ bundled = Path(sys._MEIPASS) / _BUNDLED_CONFIG_FILE_NAME # noqa: SLF001
try:
home.mkdir(parents=True, exist_ok=True)
if bundled.is_file():
@@ -131,5 +346,4 @@ def _apply() -> None:
if not _is_set("JARVIS_DATA_DIR"):
os.environ["JARVIS_DATA_DIR"] = str(home / "data")
-
_apply()
diff --git a/packaging/windows/PersonalJarvis.iss b/packaging/windows/PersonalJarvis.iss
index 760d30f867..57b0e879e9 100644
--- a/packaging/windows/PersonalJarvis.iss
+++ b/packaging/windows/PersonalJarvis.iss
@@ -1,4 +1,4 @@
-; Inno Setup script for the Personal Jarvis Windows installer.
+; Inno Setup script for the Dodaios Windows installer (formerly Personal Jarvis).
;
; Shape of the install, and why:
; * PER-USER (PrivilegesRequired=lowest, {localappdata}\Programs). Exactly how
@@ -12,13 +12,19 @@
; file with /SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /RELAUNCH=1
; /WAITPID=<pid> /LOG=<file>, so Setup first waits for the old app to exit
; (InitializeSetup), Restart Manager closes anything still holding a file,
-; the files are replaced, and the second [Run] entry starts Personal
-; Jarvis again.
+; the files are replaced, and the second [Run] entry starts Dodaios
+; again.
; (/RESTARTAPPLICATIONS would only restart apps registered with
; RegisterApplicationRestart, which this one is not.)
; * The uninstaller removes the program directory ONLY. Settings, memory,
-; skills and logs live in %LOCALAPPDATA%\Jarvis and are deliberately kept, so
+; skills and logs live in %LOCALAPPDATA%\Dodaios and are deliberately kept, so
; an uninstall/reinstall cycle does not destroy the user's data.
+; * The product was called Personal Jarvis. An upgrade keeps the install
+; directory (Inno reuses it by AppId), names the Start-menu group and the
+; shortcuts Dodaios, and deletes the shortcuts the earlier name left behind
+; ([InstallDelete]). The bundle still ships PersonalJarvis.exe beside
+; DodaiosApp.exe, so a pinned taskbar button or a logon task aimed at the
+; old file keeps working.
;
; Compile through packaging/windows/build.ps1, which passes the version:
; ISCC.exe /DAppVersion=1.5.3 /DSourceDir=<dist\Jarvis> /DOutputDir=<out> ...
@@ -37,20 +43,34 @@
#endif
; NEVER change this default. It is the identity Windows upgrades against. Only
; the installer end-to-end test overrides it (/DAppGuid=...), so its throwaway
-; install can never touch, upgrade or uninstall a real Personal Jarvis.
+; install can never touch, upgrade or uninstall a real Dodaios install.
#ifndef AppGuid
#define AppGuid "7F1C4E42-2E5B-4F0A-9E1B-1A7B6C0D5E88"
#endif
-#define AppName "Personal Jarvis"
-#define AppPublisher "Personal Jarvis"
+#define AppName "Dodaios"
+#define AppPublisher "Dodaios"
#define AppUrl "https://github.com/Dodaios/Dodaios"
-#define GuiExeName "PersonalJarvis.exe"
+#define GuiExeName "DodaiosApp.exe"
+; The windowed launcher's earlier name. The bundle ships it too (jarvis.spec).
+#define LegacyGuiExeName "PersonalJarvis.exe"
+; The product's earlier name: the Start-menu group and the shortcuts an
+; earlier release created are spelled this way.
+#define LegacyAppName "Personal Jarvis"
+; TODO(signpath): the SignPath artifact configuration pins the setup file's
+; product name (docs/code-signing-policy.md). It keeps the earlier value until
+; the maintainer updates that configuration; then set it to the AppName.
+#define SignedProductName "Personal Jarvis"
+; The same SignPath configuration pins the setup's FILE name, so the setup is
+; built and signed under the earlier name. The release publishes a
+; byte-identical Dodaios-Setup-x64.exe next to it, copied after signing
+; (scripts/ci/installer_aliases.py).
+#define SignedSetupBaseName "PersonalJarvis-Setup-x64"
#define CliExeName "dodaios.exe"
; The command's earlier name. The bundle ships it beside CliExeName, in the
; same folder the PATH task adds, so both names work in a terminal.
#define LegacyCliExeName "jarvis.exe"
-#define UserDataDirDisplay "%LOCALAPPDATA%\Jarvis"
+#define UserDataDirDisplay "%LOCALAPPDATA%\Dodaios"
[Setup]
; NEVER change AppGuid's default (see its #define above).
@@ -59,6 +79,9 @@ AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
VersionInfoVersion={#AppVersion}
+; Pinned rather than derived from AppName: see SignedProductName above.
+VersionInfoProductName={#SignedProductName}
+VersionInfoDescription={#SignedProductName} Setup
AppPublisher={#AppPublisher}
AppPublisherURL={#AppUrl}
AppSupportURL={#AppUrl}
@@ -69,6 +92,8 @@ PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
DefaultDirName={localappdata}\Programs\{#AppName}
DefaultGroupName={#AppName}
+; An upgrade from Personal Jarvis would otherwise keep the old group name.
+UsePreviousGroup=no
DisableProgramGroupPage=yes
AllowNoIcons=yes
@@ -79,7 +104,7 @@ ArchitecturesInstallIn64BitMode=x64compatible
MinVersion=10.0
OutputDir={#OutputDir}
-OutputBaseFilename=PersonalJarvis-Setup-x64
+OutputBaseFilename={#SignedSetupBaseName}
SetupIconFile={#IconFile}
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\{#GuiExeName}
@@ -106,6 +131,15 @@ Name: "addtopath"; Description: "Add the ""dodaios"" command to PATH (lets you r
[Files]
Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+[InstallDelete]
+; The Start-menu group and the Desktop shortcut of the earlier product name.
+; The group's own shortcuts are this installer's; the Desktop one is removed
+; only when it starts this installation, never a shortcut of another install.
+Type: files; Name: "{autoprograms}\{#LegacyAppName}\{#LegacyAppName}.lnk"
+Type: files; Name: "{autoprograms}\{#LegacyAppName}\Uninstall {#LegacyAppName}.lnk"
+Type: dirifempty; Name: "{autoprograms}\{#LegacyAppName}"
+Type: files; Name: "{userdesktop}\{#LegacyAppName}.lnk"; Check: LegacyShortcutStartsThisApp('{userdesktop}\{#LegacyAppName}.lnk')
+
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#GuiExeName}"; WorkingDir: "{app}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
@@ -290,6 +324,27 @@ begin
BroadcastEnvironmentChange;
end;
+{ True when the shortcut at LinkPath (constants allowed) starts a program of
+ this installation, so deleting it never takes another install's launcher. }
+function LegacyShortcutStartsThisApp(const LinkPath: string): Boolean;
+var
+ Shell, Link: Variant;
+ Target, AppDir: string;
+begin
+ Result := False;
+ if not FileExists(ExpandConstant(LinkPath)) then
+ Exit;
+ try
+ Shell := CreateOleObject('WScript.Shell');
+ Link := Shell.CreateShortcut(ExpandConstant(LinkPath));
+ Target := Link.TargetPath;
+ except
+ Exit;
+ end;
+ AppDir := Lowercase(AddBackslash(ExpandConstant('{app}')));
+ Result := Pos(AppDir, Lowercase(Target)) = 1;
+end;
+
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
diff --git a/packaging/windows/build.ps1 b/packaging/windows/build.ps1
index 29e5ab274a..58bbd69e7f 100644
--- a/packaging/windows/build.ps1
+++ b/packaging/windows/build.ps1
@@ -10,8 +10,12 @@
2. freeze the app with PyInstaller (jarvis.spec, onedir),
3. wrap dist/Jarvis in an Inno Setup wizard.
- The result is dist/installers/PersonalJarvis-Setup-x64.exe - the exact asset
- name the website's download button and the in-app updater expect.
+ The result is dist/installers/PersonalJarvis-Setup-x64.exe - the name the
+ SignPath artifact configuration pins (docs/code-signing-policy.md). A
+ release signs it under that name and then publishes it twice with identical
+ bytes: as Dodaios-Setup-x64.exe and as PersonalJarvis-Setup-x64.exe, the
+ name installs from before the rename look for
+ (scripts/ci/installer_aliases.py).
Every failure stops the script with a non-zero exit code; nothing is left
half-built and reported as success.
@@ -151,7 +155,9 @@ if ($SkipPyInstaller) {
-WorkingDirectory $RepoRoot -What "pyinstaller"
}
-foreach ($required in @("PersonalJarvis.exe", "dodaios.exe", "jarvis.exe")) {
+# The windowed launcher under its current and its earlier name, then the CLI
+# under both of its names (jarvis.spec).
+foreach ($required in @("DodaiosApp.exe", "PersonalJarvis.exe", "dodaios.exe", "jarvis.exe")) {
$candidate = Join-Path $BundleDir $required
if (-not (Test-Path $candidate)) {
Stop-WithError "the frozen bundle is missing $required (expected at $candidate)"
@@ -207,6 +213,7 @@ $IsccArgs = @(
)
Invoke-Checked -Executable $Iscc -Arguments $IsccArgs -WorkingDirectory $RepoRoot -What "ISCC"
+# The signed name (OutputBaseFilename = SignedSetupBaseName in the .iss).
$Artifact = Join-Path $InstallerDir "PersonalJarvis-Setup-x64.exe"
if (-not (Test-Path $Artifact)) {
Stop-WithError "ISCC reported success but $Artifact does not exist"
diff --git a/pyproject.toml b/pyproject.toml
index cea208cebd..525d625fe0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -8,7 +8,10 @@ requires = ["setuptools>=83", "wheel"]
build-backend = "setuptools.build_meta"
[project]
-name = "personal-jarvis"
+# Releases also publish this wheel as "personal-jarvis", its earlier name, for a
+# transition (scripts/ci/build_distributions.py). Keep the self-references in
+# the extras below spelled with this name: that script rewrites them together.
+name = "dodaios"
version = "3.2.0"
description = "Turn your computer into an AI agent that coordinates apps, tools, models, and other agents"
requires-python = ">=3.11,<3.15"
@@ -279,7 +282,7 @@ dev = [
# packages were base dependencies until the cloud-first split; tests still
# construct them, so the dev/CI environment keeps them via this self-reference
# while the base install stays lean.
- "personal-jarvis[desktop,local-voice]",
+ "dodaios[desktop,local-voice]",
"pytest>=8.3",
"pytest-asyncio>=0.24",
"pytest-cov>=6.0",
@@ -296,7 +299,7 @@ dev = [
# native-engine-minimal floor for CI and tiny headless servers; users are pointed
# at [full].
full = [
- "personal-jarvis[desktop,desktop-macos,telephony,channels,local-voice]",
+ "dodaios[desktop,desktop-macos,telephony,channels,local-voice]",
]
# Twilio telephony voice agent (call Jarvis on a phone number). Optional extra
# per the cloud-first doctrine: the base install must boot without it, and the
@@ -401,7 +404,7 @@ desktop = [
# into [full] would break the one advertised install path on a stock
# python:3.11-slim image — exactly what the cloud-first rule forbids. So it
# lives here: a Linux desktop user who wants a global dictation/call shortcut
-# installs ``personal-jarvis[desktop-linux]`` (needs a C compiler and
+# installs ``dodaios[desktop-linux]`` (needs a C compiler and
# linux-headers), and everyone else gets the honest, logged no-op instead of a
# failed install.
#
@@ -510,8 +513,9 @@ tts-eval = [
# are the command's earlier names: the same entry point, kept so that scripts,
# shell history and other tools that call them keep working.
# Never add a command that spells the branded launcher ignoring case (a
-# `personaljarvis` alias today): Windows paths ignore case, and the venv's
-# Scripts folder already holds `PersonalJarvis.exe`.
+# `dodaiosapp` or `personaljarvis` alias): Windows paths ignore case, and the
+# venv's Scripts folder holds `DodaiosApp.exe` (and `PersonalJarvis.exe` from
+# earlier releases).
dodaios = "dodaios.__main__:main"
jarvis = "dodaios.__main__:main"
personal-jarvis = "dodaios.__main__:main"
@@ -964,8 +968,8 @@ dodaios = [
]
[tool.setuptools.data-files]
-"share/personal-jarvis/docs" = ["docs/product/**/*.md"]
-"share/personal-jarvis/docs/legal" = ["docs/legal/TERMS.md"]
+"share/dodaios/docs" = ["docs/product/**/*.md"]
+"share/dodaios/docs/legal" = ["docs/legal/TERMS.md"]
[tool.ruff]
line-length = 100
diff --git a/requirements.txt b/requirements.txt
index 2a436cdd7b..32db0e96a7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,7 +5,7 @@
aiofiles==25.1.0 \
--hash=sha256:a8d728f0a29de45dc521f18f07297428d56992a742f0cd2701ba86e44d23d5b2 \
--hash=sha256:abe311e527c862958650f9438e859c1fa7568a141b22abcd015e120e86a85695
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
aioice==0.10.2 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:14911c15ab12d096dd14d372ebb4aecbb7420b52c9b76fdfcf54375dec17fcbf \
--hash=sha256:bf236c6829ee33c8e540535d31cd5a066b531cb56de2be94c46be76d68b1a806
@@ -13,15 +13,15 @@ aioice==0.10.2 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
aiolimiter==1.2.1 \
--hash=sha256:d3f249e9059a20badcb56b61601a83556133655c11d1eb3dd3e04ff069e5f3c7 \
--hash=sha256:e02a37ea1a855d9e832252a105420ad4d15011505512a1a1d814647451b5cca9
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
aiortc==1.15.0 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:4e1e54bff31a9c2cb654c7b7edc068085a7df53365e5df24a5cb24168e3f95f7 \
--hash=sha256:ee6c0757ca070cf6d6bee441936d6ede24eef51211bbff6653409c540f72e625
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
aiosqlite==0.22.1 \
--hash=sha256:043e0bd78d32888c0a9ca90fc788b38796843360c855a7262a532813133a0650 \
--hash=sha256:21c002eb13823fad740196c5a2e9d8e62f6243bd9e7e4a1f87fb5e44ecb4fceb
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
annotated-doc==0.0.4 \
--hash=sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320 \
--hash=sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4
@@ -35,12 +35,12 @@ annotated-types==0.7.0 \
anthropic==0.115.0 \
--hash=sha256:6bb25184441d51544f8bc9877a7efbddd9bc4a6207cce898536d84b233310f4a \
--hash=sha256:aa4bbea9272fa1cced6749728f18d0af9d7934b7268779e84d6f5a246f4b998d
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
anyio==4.15.1 \
--hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 \
--hash=sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# anthropic
# google-genai
# httpx
@@ -51,7 +51,7 @@ anyio==4.15.1 \
asyncssh==2.24.0 \
--hash=sha256:4064c590e59ce2e8d82a2f66d35f3120d765828b4df5e3dbfb07b4a8c24686c9 \
--hash=sha256:9abd46300adcb6d4b73269b34c53cd0d17a138b9a22b5b38008ce7d5808734b7
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
attrs==26.1.0 \
--hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \
--hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32
@@ -108,7 +108,7 @@ audioop-lts==0.2.2 ; python_full_version >= '3.13' \
--hash=sha256:f9ee9b52f5f857fbaf9d605a360884f034c92c1c23021fb90b2e39b8e64bede6 \
--hash=sha256:fbdd522624141e40948ab3e8cdae6e04c748d78710e9f0f8d4dae2750831de19 \
--hash=sha256:fd3d4602dc64914d462924a08c1a9816435a2155d74f325853c1f1ac3b2d9800
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
av==15.1.0 ; (python_full_version >= '3.14' and sys_platform == 'darwin') or (platform_machine == 'arm64' and sys_platform == 'darwin') \
--hash=sha256:07a8ae30c0cfc3132eff320a6b27d18a5e0dda36effd0ae28892888f4ee14729 \
--hash=sha256:08eac47a90ebae1e2bd5935f400dd515166019bab4ff5b03c4625fa6ac3a0a5e \
@@ -161,7 +161,7 @@ av==15.1.0 ; (python_full_version >= '3.14' and sys_platform == 'darwin') or (pl
--hash=sha256:f985661644879e4520d28a995fcb2afeb951bc15a1d51412eb8e5f36da85b6fe \
--hash=sha256:fe07cf7de162acc09d021e02154b1f760bca742c62609ec0ae586a6a1e0579ac
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# aiortc
av==17.1.0 ; (python_full_version < '3.14' and platform_machine != 'arm64' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32') \
--hash=sha256:1284addf3c0dd939887a9722dc30df2241a97471ad52c3c507e31583ae22ff02 \
@@ -195,7 +195,7 @@ av==17.1.0 ; (python_full_version < '3.14' and platform_machine != 'arm64' and s
--hash=sha256:ff457ed419348e5b8e8c811d341389b052c5e4d5839da3794d019b125b9fe830 \
--hash=sha256:ffbd78d73d2c9bf31e9a007c992faec3991428b2941a3b085b84fb82e8c32d19
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# aiortc
backports-tarfile==1.2.0 ; python_full_version < '3.12' \
--hash=sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34 \
@@ -494,13 +494,13 @@ charset-normalizer==3.4.7 \
--hash=sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79 \
--hash=sha256:fea24543955a6a729c45a73fe90e08c743f0b3334bbf3201e6c4bc1b0c7fa464
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# requests
click==8.4.2 \
--hash=sha256:9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6 \
--hash=sha256:e6f9f66136c816745b9d65817da91d61d957fb16e02e4dcd0552553c5a197b76
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# ddgs
# uvicorn
colorama==0.4.6 ; sys_platform == 'win32' \
@@ -518,7 +518,7 @@ coloredlogs==15.0.1 ; python_full_version < '3.14' and platform_machine == 'arm6
croniter==6.2.4 \
--hash=sha256:8ef3d544107a5c05a150a2d78f8bf5a8eb9c5c4d93405a736b824109574e3f4d \
--hash=sha256:fc124f751b1b04805c2a04b061898b436b45ab2320b045e1e052ea895de65189
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
cryptography==50.0.2 \
--hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \
--hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \
@@ -582,7 +582,7 @@ cryptography==50.0.2 \
--hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \
--hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# aiortc
# asyncssh
# google-auth
@@ -592,7 +592,7 @@ cryptography==50.0.2 \
ddgs==9.14.3 \
--hash=sha256:2bc5dceb092f330585277a8f3fc50f488828f55e09793ae85975e01b3141879c \
--hash=sha256:670f464512b5bcaa5182d2ab0cea688f23df58d7338083d68f6f37747434f53b
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
distro==1.9.0 \
--hash=sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed \
--hash=sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2
@@ -614,15 +614,15 @@ docstring-parser==0.18.0 \
elevenlabs==2.55.0 \
--hash=sha256:9d84371b766375951935d0cb6512f38fbf17d67ff3617ac6ba8756887f0118c7 \
--hash=sha256:e88a2673842dcc43bb415fc47b8064ba6cefb1b39962a52f8bc723c1a2a8ce07
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
fastapi==0.138.2 \
--hash=sha256:6432359d067a432134620e7c5e4c6e5063e7f37815bbbbf20acef14b0d2e3fc8 \
--hash=sha256:db90c1ffb5517fba5d4a9f80e866daa008747e646310c9ce155c8c535f9d1615
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
filelock==3.32.3 \
--hash=sha256:0ffa185a3540854c95caa7fa76b76cb219d907415e2c5dc9af25fd970563487f \
--hash=sha256:7f0ca4bcc0e181c60dbbd8aa9ab5b120ebb99e4e064e83636340056f833a1f09
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
flatbuffers==25.12.19 ; (python_full_version < '3.14' and platform_machine == 'arm64') or sys_platform != 'darwin' \
--hash=sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4
# via onnxruntime
@@ -633,7 +633,7 @@ gitdb==4.0.12 \
gitpython==3.1.62 \
--hash=sha256:1791de66309bc0c7cfca40bf8d2e3de7ca091cbf94e6051be1ad0722c61062af \
--hash=sha256:7002251225e10e29d2e1f49e6532613fe5d5d9f0b6f1f02997a52b38fe56899e
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
google-auth==2.55.1 \
--hash=sha256:eada68dfd52b3b81191827601e2a0c3fa12540c818534b630ddc5355769c3995 \
--hash=sha256:fb2d9b730f2c9b8d326ec8d7222f21aef2ead15bf0513793d6442485d87af0a1
@@ -676,7 +676,7 @@ google-crc32c==1.8.0 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
google-genai==2.10.0 \
--hash=sha256:77912cd558cd7dfd5b75c25fd1c609e78d7954dde583331104022a46ea90f9ee \
--hash=sha256:d5350311567ae660c24cbc1752aee4b3d660f89c0106d2dcd2a69978c35afe1e
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
h11==0.16.0 \
--hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \
--hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86
@@ -693,7 +693,7 @@ httpx==0.28.1 \
--hash=sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc \
--hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# anthropic
# elevenlabs
# google-genai
@@ -738,7 +738,7 @@ jaraco-functools==4.5.0 \
jedi==0.20.0 \
--hash=sha256:7bdd9c2634f56713299976f4cbd59cb3fa92165cc5e05ea811fb253480728b67 \
--hash=sha256:c3f4ccbd276696f4b19c54618d4fb18f9fc24b0aef02acf704b23f487daa1011
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
jeepney==0.9.0 ; sys_platform == 'linux' \
--hash=sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683 \
--hash=sha256:cf0e9e845622b81e4a28df94c40345400256ec608d0e55bb8a3feaa9163f5732
@@ -748,7 +748,7 @@ jeepney==0.9.0 ; sys_platform == 'linux' \
jinja2==3.1.6 \
--hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \
--hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
jiter==0.16.0 \
--hash=sha256:0542a7189c26920778658fc8fcf2af8bae05bae9924577f71804acef37996536 \
--hash=sha256:0758ab7747a984797cf048e8eedea1d8ef39d7994b25611daf5b48fc903e8873 \
@@ -865,12 +865,12 @@ joblib==1.5.3 ; (python_full_version < '3.14' and platform_machine == 'arm64' an
json-repair==0.61.5 \
--hash=sha256:766a712a05b5a2673212ca0df0e27e6dbb446c9b59ab837613a369304b222886 \
--hash=sha256:965cc39a7cddc84aad0a1b00a4ce44906cf14893bd0e3890a386d28ca21dd0f0
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
jsonschema==4.26.0 \
--hash=sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326 \
--hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# mcp
jsonschema-specifications==2025.9.1 \
--hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe \
@@ -879,11 +879,11 @@ jsonschema-specifications==2025.9.1 \
keyring==25.7.0 \
--hash=sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f \
--hash=sha256:fe01bd85eb3f8fb3dd0405defdeac9a5b4f6f0439edbb3149577f244a2e8245b
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
loguru==0.7.3 \
--hash=sha256:19480589e77d47b8d85b2c827ad95d49bf31b0dcde16593892eb51dd18706eb6 \
--hash=sha256:31a33c10c8e1e10422bfd431aeb5d351c7cf7fa671e3c4df004162264b28220c
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
lxml==6.1.1 \
--hash=sha256:05a82eb6e1530a64f26225b55cbd178113bd0b5af1c2b625f25e5296742c26d2 \
--hash=sha256:07a4a68e286ee7a1ed7dfb8af83e615757c0ccfe9f18c6b4ea6771388d9ba8c9 \
@@ -1023,7 +1023,7 @@ lxml==6.1.1 \
markdown==3.10.3 \
--hash=sha256:3589362618f743188b4d955b874402bc814f4f83f544dc207719f4baa7d9c45f \
--hash=sha256:fa6c92a00a4a3c98b22728c64a935ae1928250ae65058a6ded814d2cc29a4cea
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
markdown-it-py==4.2.0 \
--hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \
--hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a
@@ -1122,7 +1122,7 @@ markupsafe==3.0.3 \
mcp==1.28.1 \
--hash=sha256:2726bca5e7193f61c5dde8b12500a6de2d9acf6d1a1c0be9e8c2e706437991df \
--hash=sha256:d51e36a5f5644faea4f85ea649bfffa6bc6c26770d42798ad6a3de3d2ba69683
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
mdurl==0.1.2 \
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
@@ -1144,7 +1144,7 @@ narwhals==2.23.0 ; (python_full_version < '3.14' and platform_machine == 'arm64'
num2words==0.5.14 \
--hash=sha256:1c8e5b00142fc2966fd8d685001e36c4a9911e070d1b120e1beb721fa1edb33d \
--hash=sha256:b066ec18e56b6616a3b38086b5747daafbaa8868b226a36127e0451c0cf379c6
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
numpy==2.1.3 ; (python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32') \
--hash=sha256:016d0f6f5e77b0f0d45d77387ffa4bb89816b57c835580c3ce8e099ef830befe \
--hash=sha256:02135ade8b8a84011cbb67dc44e07c58f28575cf9ecf8ab304e51c05528c19f0 \
@@ -1202,7 +1202,7 @@ numpy==2.1.3 ; (python_full_version < '3.14' and platform_machine != 'ARM64') or
--hash=sha256:f653490b33e9c3a4c1c01d41bc2aef08f9475af51146e4a7710c450cf9761598 \
--hash=sha256:fa2d1337dc61c8dc417fbccf20f6d1e139896a30721b7f1e832b2bb6ef4eb6c4
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# onnxruntime
# scikit-learn
# scipy
@@ -1283,7 +1283,7 @@ numpy==2.3.5 ; (python_full_version >= '3.14' and platform_machine != 'ARM64') o
--hash=sha256:ffe22d2b05504f786c867c8395de703937f934272eb67586817b46188b4ded6d \
--hash=sha256:fffe29a1ef00883599d1dc2c51aa2e5d80afe49523c261a74933df395c15c520
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# onnxruntime
# scikit-learn
# scipy
@@ -1311,7 +1311,7 @@ onnxruntime==1.23.2 ; python_full_version < '3.14' and platform_machine == 'arm6
--hash=sha256:da44b99206e77734c5819aa2142c69e64f3b46edc3bd314f6a45a932defc0b3e \
--hash=sha256:e2b9233c4947907fd1818d0e581c049c41ccc39b2856cc942ff6d26317cee145
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# openwakeword
onnxruntime==1.27.0 ; sys_platform != 'darwin' \
--hash=sha256:0874edc171f470fc4dd2bbb60bc0989612ed1a8b89b365cda016630a93227f13 \
@@ -1339,23 +1339,23 @@ onnxruntime==1.27.0 ; sys_platform != 'darwin' \
--hash=sha256:e4f7b0e90d2d212e2c2deaa6c8291616183ab815d3ec558ea12d3ac8b26d36f4 \
--hash=sha256:ff050e4f6bf7f12918fa14dcb047c0b02e295f35e86d42532552be4b3d54e977
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# openwakeword
openai==2.44.0 \
--hash=sha256:0a2a3ab2e29aeda368700f662ff9ba0f9df17ba4c54577a64e08b8115a3cc0ad \
--hash=sha256:68a5a5ffad82b8ff7d451c437529fb64f7c3b8123aaf0c021966a882d9e3947d
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
opentelemetry-api==1.44.0 \
--hash=sha256:67647e5e9566edcf421166fdf022b3537f818635daa852b289e34604dc6fb33a \
--hash=sha256:94b98c893a91b88657eaac1e3ba89618cdb85be6918196705354f34728b2cdef
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# opentelemetry-sdk
# opentelemetry-semantic-conventions
opentelemetry-sdk==1.44.0 \
--hash=sha256:cebe7f65dc12f26ead75c6064de12fd2a9052e5060c0272d402cfa203aae123b \
--hash=sha256:df081c4c6bcfdb1211e3e86140376792643128a25f8d72d1d27675936e7e96ad
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
opentelemetry-semantic-conventions==0.65b0 \
--hash=sha256:1cacde7b0ad306f84c5ef08c3dbe1bbaf20165bba6f8bff43b670e555a086bcb \
--hash=sha256:f9b2b81e9d5b64f11bc952075e7e9c7fb0aab075c7fd1c46d597f1b919852d60
@@ -1363,12 +1363,12 @@ opentelemetry-semantic-conventions==0.65b0 \
openwakeword==0.6.0 ; (python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin') or (python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux') \
--hash=sha256:36858d90f1183e307485597a912a4e3c3384b14ea9923f83feaffae7c1565565 \
--hash=sha256:6f423a4e3ae9dd0e3cd12b50ff8abf69679f687b4ab349d7c82c021c0e2abc9d
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
packaging==26.2 \
--hash=sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e \
--hash=sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# onnxruntime
parso==0.8.7 \
--hash=sha256:a8926eb2a1b915486941fdbd31e86a4baf88fe8c210f25f2f35ecec5b574ca1c \
@@ -1462,11 +1462,11 @@ pillow==12.3.0 \
--hash=sha256:fdafc9cce40277e0f7a0feabce0ee50dd2fa1800f3b38015e51296b5e814048d \
--hash=sha256:fe3cca2e4e8a592be0f269a1ca4835c25199d9f3ce815c8491048f785b0a0198 \
--hash=sha256:ffd0c5368496f41b0944be820fcb7a838aa6e623d250b01acf2643939c3f99d7
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
platformdirs==4.10.0 \
--hash=sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7 \
--hash=sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
primp==1.3.1 \
--hash=sha256:0504de2901c97903a9c369856a4b186dc90a782d8320652c142b066e697d5a1a \
--hash=sha256:09ada1752629fe89d7b128beeb59cb641f404af462e24177ba36aed1cf322299 \
@@ -1503,7 +1503,7 @@ primp==1.3.1 \
prometheus-client==0.25.0 \
--hash=sha256:5e373b75c31afb3c86f1a52fa1ad470c9aace18082d39ec0d2f918d11cc9ba28 \
--hash=sha256:d5aec89e349a6ec230805d0df882f3807f74fd6c1a2fa86864e3c2279059fed1
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
protobuf==7.35.1 ; (python_full_version < '3.14' and platform_machine == 'arm64') or sys_platform != 'darwin' \
--hash=sha256:11d6b0ec246892d85215b0a13ca6e0233cf5284b68f0ac02646427f4ff88a799 \
--hash=sha256:230a75ddfc2de4806e56696ce9640c1cdfdb6543b7cfce98d42a4c0a0e7bdb87 \
@@ -1536,7 +1536,7 @@ psutil==7.2.2 \
--hash=sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486 \
--hash=sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00 \
--hash=sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
pyasn1==0.6.4 \
--hash=sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81 \
--hash=sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b
@@ -1553,7 +1553,7 @@ pydantic==2.13.4 \
--hash=sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba \
--hash=sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# anthropic
# elevenlabs
# fastapi
@@ -1689,7 +1689,7 @@ pydantic-settings==2.14.2 \
--hash=sha256:a20c97b37910b6550d5ea50fbcc2d4187defe58cd57070b73863d069419c9440 \
--hash=sha256:c19dd64b19097f1de80184f0cc7b0272a13ae6e170cbf240a3e27e381ed14a5f
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# mcp
pyee==13.0.1 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:0b931f7c14535667ed4c7e0d531716368715e860b988770fc7eb8578d1f67fc8 \
@@ -1703,7 +1703,7 @@ pyjwt==2.15.1 \
--hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 \
--hash=sha256:4f259e80cdfb6b3fc18a7de51fd1ef9ec79652f25019bae68975ca2468a34df8
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# mcp
pylibsrtp==1.0.0 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:2696bdb2180d53ac55d0eb7b58048a2aa30cd4836dd2ca683669889137a94d2a \
@@ -1726,7 +1726,7 @@ pyopenssl==26.4.0 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
pypdf==6.19.0 \
--hash=sha256:7e5d6e730e7dae87d560a2cee218b852f6498c8be61966f3cd02ead971e48d14 \
--hash=sha256:bbc43aca292369ccc6cbc8a921991ecf2538a3587ab5a116eff06c321d647155
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
python-dateutil==2.9.0.post0 \
--hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \
--hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427
@@ -1742,7 +1742,7 @@ python-multipart==0.0.32 \
python-telegram-bot==22.8 \
--hash=sha256:42373918097f1b837cc4e717d588c19ea79651497ec712bb5b0c76e5e63c50e1 \
--hash=sha256:f9d3847fcb23ee603477e442800b33bb4adf851a73e0619d2050be879decf1ef
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
pywin32==312 ; sys_platform == 'win32' \
--hash=sha256:02ebca0f0242b75292e218065004310d6a477407c09fa449bfe4f6022bc0c0fc \
--hash=sha256:17948aeadbdb091f0ced6ef0841620794e68327b94ee415571c1203594b7215c \
@@ -1844,7 +1844,7 @@ pyyaml==6.0.3 \
--hash=sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6 \
--hash=sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926 \
--hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
referencing==0.37.0 \
--hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 \
--hash=sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8
@@ -1864,7 +1864,7 @@ rich==15.0.0 \
--hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \
--hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# typer
rpds-py==2026.6.3 \
--hash=sha256:0be972be84cfcaf46c8c6edf690ca0f154ac17babf1f6a955a51579b34ad2dc5 \
@@ -2082,7 +2082,7 @@ scipy==1.17.1 ; python_full_version < '3.12' \
--hash=sha256:f8885db0bc2bffa59d5c1b72fad7a6a92d3e80e7257f967dd81abb553a90d293 \
--hash=sha256:fcb310ddb270a06114bb64bbe53c94926b943f5b7f0842194d585c65eb4edd76
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# openwakeword
# scikit-learn
scipy==1.18.0 ; python_full_version >= '3.12' \
@@ -2128,7 +2128,7 @@ scipy==1.18.0 ; python_full_version >= '3.12' \
--hash=sha256:f2a6af57bd9e4a75d70e4117e78a1bbee84f79ae3fbb6d0111005d6ebcc4cb8d \
--hash=sha256:f351e0dd702687d12a402b867a1b4146a256923e1c38317cbc472f6372b94707
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# openwakeword
# scikit-learn
secretstorage==3.5.0 ; sys_platform == 'linux' \
@@ -2138,7 +2138,7 @@ secretstorage==3.5.0 ; sys_platform == 'linux' \
send2trash==2.1.0 \
--hash=sha256:0da2f112e6d6bb22de6aa6daa7e144831a4febf2a87261451c4ad849fe9a873c \
--hash=sha256:1c72b39f09457db3c05ce1d19158c2cbef4c32b8bedd02c155e49282b7ea7459
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
shellingham==1.5.4 \
--hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \
--hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de
@@ -2165,7 +2165,7 @@ sounddevice==0.5.5 \
--hash=sha256:30ff99f6c107f49d25ad16a45cacd8d91c25a1bcdd3e81a206b921a3a6405b1f \
--hash=sha256:3861901ddd8230d2e0e8ae62ac320cdd4c688d81df89da036dcb812f757bb3e6 \
--hash=sha256:cfc6b2c49fb7f555591c78cb8ecf48d6a637fd5b6e1db5fec6ed9365d64b3519
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
srt==3.5.3 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:4884315043a4f0740fd1f878ed6caa376ac06d70e135f306a6dc44632eed0cc0
# via vosk
@@ -2183,7 +2183,7 @@ starlette==1.3.1 \
structlog==26.1.0 \
--hash=sha256:e081a26d6c373e6d201eca24eede26d8ffab07f88f477822e679183428d3d91e \
--hash=sha256:f63a716cbd1b1291cf7661de7794b455acfa4c43c5bcf1630e6ad5ddc1adb3b7
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
sympy==1.14.0 ; python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin' \
--hash=sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517 \
--hash=sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5
@@ -2192,7 +2192,7 @@ tenacity==9.1.4 \
--hash=sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55 \
--hash=sha256:adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# google-genai
tflite-runtime==2.14.0 ; python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' \
--hash=sha256:195ab752e7e57329a68e54dd3dd5439fad888b9bff1be0f0dc042a3237a90e4d \
@@ -2215,7 +2215,7 @@ threadpoolctl==3.6.0 ; (python_full_version < '3.14' and platform_machine == 'ar
tomlkit==0.15.1 \
--hash=sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304 \
--hash=sha256:e25bbf38843005246210a12982776f27f99cb9be67160e14434d0c0d21ee1e97
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
tqdm==4.68.3 \
--hash=sha256:00dfa48452b6b6cfae3dd9885636c23d3422d1ec97c66d96818cbd5e0821d482 \
--hash=sha256:39832cc2def2789a6f29df83f172db7416cea70052c0907a57801c5f2fdccb03
@@ -2226,7 +2226,7 @@ tqdm==4.68.3 \
typer==0.27.1 \
--hash=sha256:53150287edd11baeb4e4722c8e394fcdf8181c0ae89485cba8d25c778d5edd56 \
--hash=sha256:a79bef8469a79c45498e7b814ecf8d603cc7644e9acbd9e19cac0334240b18df
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
typing-extensions==4.16.0 \
--hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \
--hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5
@@ -2260,18 +2260,18 @@ typing-inspection==0.4.2 \
tzdata==2026.3 \
--hash=sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415 \
--hash=sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
urllib3==2.8.0 \
--hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \
--hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# requests
uvicorn==0.52.4 \
--hash=sha256:73acfee47a0b133c5de13d219492d62d8a31e935f4fe6e41a232451a15379f86 \
--hash=sha256:f86e41a149d7d05a9969337e3946a9c171c06a5d42680896daaba624aeac8da1
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# mcp
vosk==0.3.44 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:029d0b3d6a5cff874c575b8a5814a4cccfb37608cff52e846c02a8c67a882801 \
@@ -2280,7 +2280,7 @@ vosk==0.3.44 ; platform_machine != 'ARM64' or sys_platform != 'win32' \
--hash=sha256:93895a51b8bd7b4c780eef05a3d99bf2af03f02fe5f4e4bba3da17bd0fd69138 \
--hash=sha256:9995b7fa5434b134b4bd09897e2490dbc56115c2ad2943c030621e10c7037b34 \
--hash=sha256:a0d4a2c384692d721d4cda58aa79aac22edb0c445759e9ca2df61f44a5d2fdda
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
watchdog==6.0.0 ; (python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32') \
--hash=sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a \
--hash=sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2 \
@@ -2312,7 +2312,7 @@ watchdog==6.0.0 ; (python_full_version < '3.14' and sys_platform == 'darwin') or
--hash=sha256:e6f0e77c9417e7cd62af82529b10563db3423625c5fce018430b249bf977f9e8 \
--hash=sha256:e7631a77ffb1f7d2eefa4445ebbee491c720a5661ddf6df3498ebecae5ed375c \
--hash=sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2
- # via personal-jarvis (pyproject.toml)
+ # via dodaios (pyproject.toml)
websockets==16.0 \
--hash=sha256:0298d07ee155e2e9fda5be8a9042200dd2e3bb0b8a38482156576f863a9d457c \
--hash=sha256:04cdd5d2d1dacbad0a7bf36ccbcd3ccd5a30ee188f2560b7a62a30d14107b31a \
@@ -2376,7 +2376,7 @@ websockets==16.0 \
--hash=sha256:f4a32d1bd841d4bcbffdcb3d2ce50c09c3909fbead375ab28d0181af89fd04da \
--hash=sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4
# via
- # personal-jarvis (pyproject.toml)
+ # dodaios (pyproject.toml)
# elevenlabs
# google-genai
# vosk
diff --git a/scoop-bucket/personal-jarvis-installer.json b/scoop-bucket/personal-jarvis-installer.json
deleted file mode 100644
index 3527498030..0000000000
--- a/scoop-bucket/personal-jarvis-installer.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "version": "1.0.5",
- "description": "Supply-chain hardened installer for Personal Jarvis (cosign + offline Ed25519 + SLSA L3 + ML-DSA-65 + payload-commit pin). Scoop distribution makes the package manager's own signing chain the bootstrap-trust root, independent of github.com TLS.",
- "homepage": "https://github.com/Dodaios/Dodaios",
- "license": "MIT",
- "notes": [
- "After install, run: personal-jarvis-installer",
- "The installer runs a multi-stage supply-chain verifier (Wave 1 cosign + Wave 2 offline Ed25519 + Wave 3 SLSA L3 + Wave 4 ML-DSA-65 + Wave 5 payload-commit pin) before handing off to the second-stage installer."
- ],
- "architecture": {
- "64bit": {
- "url": "https://github.com/Dodaios/Dodaios/releases/download/v1.0.5/install-verify.ps1",
- "hash": "sha256:5d5cb9d9f853d72b268ab099186de880c1b961ad60f82db327f04d6fd1791e34"
- }
- },
- "bin": [
- [
- "install-verify.ps1",
- "personal-jarvis-installer"
- ]
- ],
- "checkver": {
- "github": "https://github.com/Dodaios/Dodaios",
- "regex": "releases/tag/v([\\d.]+)"
- },
- "autoupdate": {
- "architecture": {
- "64bit": {
- "url": "https://github.com/Dodaios/Dodaios/releases/download/v$version/install-verify.ps1"
- }
- },
- "hash": {
- "url": "https://github.com/Dodaios/Dodaios/releases/download/v$version/checksums.txt",
- "regex": "(?<sha256>[a-fA-F0-9]{64})\\s+\\*?install-verify\\.ps1"
- }
- }
-}
diff --git a/scripts/ci/build_distributions.py b/scripts/ci/build_distributions.py
new file mode 100644
index 0000000000..0feb155860
--- /dev/null
+++ b/scripts/ci/build_distributions.py
@@ -0,0 +1,141 @@
+#!/usr/bin/env python3
+"""Build the sdist and wheel under the distribution name and under its earlier name.
+
+ python scripts/ci/build_distributions.py --outdir dist
+
+The project is ``dodaios`` on PyPI now; until existing installs have moved,
+every release also publishes the SAME code as ``personal-jarvis``, so
+``pip install -U personal-jarvis`` keeps updating. The second build runs on a
+rewritten ``pyproject.toml`` that differs only in the names: the project name,
+the self-references in the extras (``personal-jarvis[full]`` must never pull
+in ``dodaios``) and the ``share/<name>`` data-file directory. The original
+file is restored afterwards, whatever happens.
+
+Output: ``<outdir>/<name>/`` per distribution, one wheel and one sdist each,
+so the publish job can upload them as two separate steps.
+"""
+
+from __future__ import annotations
+
+import argparse
+import re
+import shutil
+import subprocess
+import sys
+import tomllib
+from collections.abc import Callable, Sequence
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+CURRENT = "dodaios"
+LEGACY = "personal-jarvis"
+
+Runner = Callable[[Sequence[str], Path], None]
+
+
+def _normalized(name: str) -> str:
+ """The file-name spelling of a distribution name (PEP 427 / PEP 625)."""
+ return re.sub(r"[-_.]+", "_", name).lower()
+
+
+def renamed_pyproject(text: str, current: str = CURRENT, legacy: str = LEGACY) -> str:
+ """``pyproject.toml`` text with every spelling of the project's name replaced."""
+ project = tomllib.loads(text)["project"]
+ if project["name"] != current:
+ raise ValueError(f"pyproject names {project['name']!r}, expected {current!r}")
+ text, count = re.subn(
+ rf'(?m)^name = "{re.escape(current)}"(?=\r?$)', f'name = "{legacy}"', text, count=1
+ )
+ if count != 1:
+ raise ValueError("pyproject.toml has no top-level project name line")
+ # Self-references in the extras: "dodaios[desktop,...]".
+ text = text.replace(f'"{current}[', f'"{legacy}[')
+ # Data files: "share/dodaios/docs" = [...].
+ text = text.replace(f'"share/{current}/', f'"share/{legacy}/')
+ renamed = tomllib.loads(text)
+ if renamed["project"]["name"] != legacy:
+ raise ValueError("the rewritten pyproject.toml does not name the earlier distribution")
+ extras = renamed["project"].get("optional-dependencies", {})
+ for requirement in (item for group in extras.values() for item in group):
+ if re.match(rf"{re.escape(current)}\s*\[", requirement):
+ raise ValueError(f"an extra still refers to {current}: {requirement}")
+ data_files = renamed.get("tool", {}).get("setuptools", {}).get("data-files", {})
+ for target in data_files:
+ if not target.startswith(f"share/{legacy}/"):
+ raise ValueError(f"a data file still installs outside share/{legacy}: {target}")
+ return text
+
+
+def _run(command: Sequence[str], cwd: Path) -> None:
+ subprocess.run(list(command), cwd=cwd, check=True)
+
+
+def _clean_build_state(root: Path) -> None:
+ """Leftovers of one build must not leak into the next one's sdist or wheel.
+
+ Only what setuptools writes: a PyInstaller freeze keeps its own folder
+ under ``build/``.
+ """
+ stale = [root / "build" / "lib", *(root / "build").glob("bdist.*")]
+ stale += [root / f"{_normalized(name)}.egg-info" for name in (CURRENT, LEGACY)]
+ for path in stale:
+ shutil.rmtree(path, ignore_errors=True)
+
+
+def expected_artifacts(name: str, version: str) -> set[str]:
+ stem = f"{_normalized(name)}-{version}"
+ return {f"{stem}.tar.gz", f"{stem}-py3-none-any.whl"}
+
+
+def build_all(
+ outdir: Path,
+ *,
+ root: Path = ROOT,
+ build_command: Sequence[str] = (sys.executable, "-m", "build", "--no-isolation"),
+ runner: Runner = _run,
+) -> dict[str, Path]:
+ """Build both distributions; return ``{name: its output directory}``."""
+ pyproject = root / "pyproject.toml"
+ original = pyproject.read_bytes()
+ text = original.decode("utf-8")
+ version = tomllib.loads(text)["project"]["version"]
+ legacy_text = renamed_pyproject(text)
+ outputs = {CURRENT: outdir / CURRENT, LEGACY: outdir / LEGACY}
+ for directory in outputs.values():
+ if directory.exists() and any(directory.iterdir()):
+ raise ValueError(f"output directory is not empty: {directory}")
+ try:
+ _clean_build_state(root)
+ runner([*build_command, "--outdir", str(outputs[CURRENT])], root)
+ _clean_build_state(root)
+ pyproject.write_bytes(legacy_text.encode("utf-8"))
+ runner([*build_command, "--outdir", str(outputs[LEGACY])], root)
+ finally:
+ pyproject.write_bytes(original)
+ _clean_build_state(root)
+ for name, directory in outputs.items():
+ found = {path.name for path in directory.iterdir()} if directory.is_dir() else set()
+ expected = expected_artifacts(name, version)
+ if found != expected:
+ raise ValueError(
+ f"{name}: built {sorted(found)}, expected {sorted(expected)}"
+ )
+ return outputs
+
+
+def main(argv: list[str] | None = None) -> int:
+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
+ parser.add_argument("--outdir", type=Path, required=True)
+ args = parser.parse_args(argv)
+ try:
+ outputs = build_all(args.outdir.resolve())
+ except (OSError, ValueError, subprocess.CalledProcessError) as exc:
+ print(f"::error::building the distributions failed: {exc}")
+ return 1
+ for name, directory in outputs.items():
+ print(f"[build] {name}: {', '.join(sorted(p.name for p in directory.iterdir()))}")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/scripts/ci/check_frozen_macos_app.py b/scripts/ci/check_frozen_macos_app.py
index bea207d2d8..d52c63d6ff 100644
--- a/scripts/ci/check_frozen_macos_app.py
+++ b/scripts/ci/check_frozen_macos_app.py
@@ -39,7 +39,7 @@ It also asserts the privacy-permission declarations of the bundle:
run the app.
Usage:
- python scripts/ci/check_frozen_macos_app.py --app "dist/Personal Jarvis.app"
+ python scripts/ci/check_frozen_macos_app.py --app "dist/Dodaios.app"
Exit codes: 0 = fine (skipped parts are printed as NOTE lines), 1 = the app would
ship broken (problems listed), 2 = could not check (missing file, unreadable
@@ -343,7 +343,7 @@ def check_app(
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
- parser.add_argument("--app", required=True, type=Path, help="the built Personal Jarvis.app")
+ parser.add_argument("--app", required=True, type=Path, help="the built Dodaios.app")
args = parser.parse_args(argv)
notes: list[str] = []
try:
diff --git a/scripts/ci/check_portable_install_matrix.py b/scripts/ci/check_portable_install_matrix.py
index 0e2e506800..d1253ce4d6 100644
--- a/scripts/ci/check_portable_install_matrix.py
+++ b/scripts/ci/check_portable_install_matrix.py
@@ -4,7 +4,7 @@
This gate models the two installer phases users actually receive:
1. the universal, hash-pinned ``requirements.txt`` base install;
-2. that base plus the advertised ``personal-jarvis[full]`` profile.
+2. that base plus the advertised ``dodaios[full]`` profile.
For every supported CPython/OS/architecture cell, uv produces a target-specific
PEP 751 lock. Only packages whose markers are active in that cell are checked.
@@ -718,7 +718,7 @@ def _compile_command(
profile: str,
) -> list[str]:
sources = [str(REQUIREMENTS_TXT), str(PYPROJECT)]
- extra_flags: list[str] = ["--no-emit-package", "personal-jarvis"]
+ extra_flags: list[str] = ["--no-emit-package", "dodaios"]
if profile == "full":
extra_flags.extend(("--extra", "full"))
return [
diff --git a/scripts/ci/classify_changes.py b/scripts/ci/classify_changes.py
index bdb7b2a8ad..3a7babb137 100644
--- a/scripts/ci/classify_changes.py
+++ b/scripts/ci/classify_changes.py
@@ -49,8 +49,6 @@ from scripts.ci import agent_runtime_suite # noqa: E402
# Everything NOT listed keeps the python lane on — unknown means relevant.
_PY_IRRELEVANT_PREFIXES = (
"wiki-video/",
- "homebrew-tap/",
- "scoop-bucket/",
"board-backend/",
"qa/",
"skillbook/",
diff --git a/scripts/ci/cut_release.py b/scripts/ci/cut_release.py
index 8fc1da5f23..78ee6302f2 100644
--- a/scripts/ci/cut_release.py
+++ b/scripts/ci/cut_release.py
@@ -107,17 +107,6 @@ def apply(version: str, notes: str, today: str, root: Path = REPO_ROOT) -> None:
text = init.read_text(encoding="utf-8")
text = re.sub(r'__version__ = "[^"]+"', f'__version__ = "{version}"', text, count=1)
init.write_bytes(text.encode("utf-8"))
- lockfile = root / "uv.lock"
- if lockfile.exists():
- text = lockfile.read_text(encoding="utf-8")
- text, count = re.subn(
- r'(?m)(^\[\[package\]\]\nname = "personal-jarvis"\nversion = ")[^"]+',
- lambda match: match.group(1) + version,
- text,
- )
- if count != 1:
- raise SystemExit("uv.lock must contain one personal-jarvis workspace package")
- lockfile.write_bytes(text.encode("utf-8"))
changelog = root / "CHANGELOG.md"
head, _body, rest = split_unreleased(changelog.read_text(encoding="utf-8"))
section = f"## [{version}] — {today}\n\n{notes.strip()}\n\n---\n\n"
diff --git a/scripts/ci/installer_aliases.py b/scripts/ci/installer_aliases.py
new file mode 100644
index 0000000000..4e05e25cb1
--- /dev/null
+++ b/scripts/ci/installer_aliases.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python3
+"""Give every native installer both of its release names, with identical bytes.
+
+The build names most installers with the current prefix (``Dodaios-``), while
+installs frozen before the rename only look for the earlier one
+(``PersonalJarvis-``). The Windows setup goes the other way: its signing
+configuration pins the earlier name, so it is signed under that name and the
+current name is the copy. Either way, this runs AFTER signing, so both names
+always carry the same signed file.
+
+ python scripts/ci/installer_aliases.py installers
+
+For every pair in ``release_assets.INSTALLER_NAME_PAIRS`` exactly one file must
+exist (it is copied to the other name), or both with identical content. A
+pair with neither file, or with two different files, fails.
+"""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import shutil
+import sys
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+if str(ROOT) not in sys.path:
+ sys.path.insert(0, str(ROOT))
+
+from scripts.ci.release_assets import INSTALLER_NAME_PAIRS # noqa: E402
+
+
+def _digest(path: Path) -> str:
+ with path.open("rb") as stream:
+ return hashlib.file_digest(stream, "sha256").hexdigest()
+
+
+def add_aliases(directory: Path) -> list[str]:
+ """Copy each installer to its missing name; return the names it wrote."""
+ written = []
+ for current, earlier in INSTALLER_NAME_PAIRS:
+ paths = (directory / current, directory / earlier)
+ present = [path for path in paths if path.is_file() and not path.is_symlink()]
+ if not present:
+ raise ValueError(f"no installer under either name: {current}, {earlier}")
+ if len(present) == 2:
+ if _digest(paths[0]) != _digest(paths[1]):
+ raise ValueError(f"installer names differ in content: {current} and {earlier}")
+ continue
+ source = present[0]
+ target = paths[1] if source == paths[0] else paths[0]
+ if target.exists() or target.is_symlink():
+ raise ValueError(f"refusing to replace a non-file installer name: {target.name}")
+ shutil.copyfile(source, target)
+ if _digest(source) != _digest(target):
+ raise ValueError(f"copy of {source.name} does not match its source")
+ written.append(target.name)
+ return written
+
+
+def main(argv: list[str] | None = None) -> int:
+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
+ parser.add_argument("directory", type=Path)
+ args = parser.parse_args(argv)
+ try:
+ written = add_aliases(args.directory)
+ except (OSError, ValueError) as exc:
+ print(f"::error::{exc}")
+ return 1
+ for name in written:
+ print(f"[release] {name}: byte-identical copy")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/scripts/ci/privacy_gate/scripts/strip_and_scan.py b/scripts/ci/privacy_gate/scripts/strip_and_scan.py
index 37e816a3e9..15b2b2cec5 100644
--- a/scripts/ci/privacy_gate/scripts/strip_and_scan.py
+++ b/scripts/ci/privacy_gate/scripts/strip_and_scan.py
@@ -697,7 +697,8 @@ def cmd_set_version(args: argparse.Namespace) -> int:
# portable-install-matrix gate went red on the release commit).
tree / "uv.lock": (
re.compile(
- r'(\[\[package\]\]\nname = "personal-jarvis"\nversion = ")[^"]*(")'
+ # The project under its current or its earlier distribution name.
+ r'(\[\[package\]\]\nname = "(?:dodaios|personal-jarvis)"\nversion = ")[^"]*(")'
),
rf'\g<1>{version}\g<2>',
),
diff --git a/scripts/ci/release_assets.py b/scripts/ci/release_assets.py
index 5344b3c4e7..259a1a73ec 100644
--- a/scripts/ci/release_assets.py
+++ b/scripts/ci/release_assets.py
@@ -25,12 +25,19 @@ PUBLISHER_JOBS = {
"desktop-installers.yml": "Checksums and GitHub Release",
"sign-installer.yml": "release",
}
-INSTALLERS = {
- "PersonalJarvis-Setup-x64.exe",
- "PersonalJarvis-macOS-arm64.dmg",
- "PersonalJarvis-macOS-x64.dmg",
- "PersonalJarvis-Linux-x86_64.AppImage",
-}
+#: Every native installer as ``(current name, earlier name)``. A release
+#: publishes BOTH files with identical bytes: the build names its output with
+#: the current prefix, and installs frozen before the rename only look for the
+#: earlier one. The Windows setup is the exception on the build side: its
+#: signing configuration pins the earlier name, so the current name is the
+#: copy, made after signing (``installer_aliases.py``).
+INSTALLER_NAME_PAIRS = (
+ ("Dodaios-Setup-x64.exe", "PersonalJarvis-Setup-x64.exe"),
+ ("Dodaios-macOS-arm64.dmg", "PersonalJarvis-macOS-arm64.dmg"),
+ ("Dodaios-macOS-x64.dmg", "PersonalJarvis-macOS-x64.dmg"),
+ ("Dodaios-Linux-x86_64.AppImage", "PersonalJarvis-Linux-x86_64.AppImage"),
+)
+INSTALLERS = {name for pair in INSTALLER_NAME_PAIRS for name in pair}
SIGNED = {
"install.sh",
"install.ps1",
@@ -61,11 +68,24 @@ REQUIRED_ASSETS = (
DESKTOP_ASSETS = INSTALLERS | {"installers-SHA256SUMS.txt"}
SIGNING_ASSETS = REQUIRED_ASSETS - DESKTOP_ASSETS
PLATFORM_INSTALLERS = {
- "linux": {"PersonalJarvis-Linux-x86_64.AppImage"},
- "windows": {"PersonalJarvis-Setup-x64.exe"},
- "macos": {"PersonalJarvis-macOS-arm64.dmg", "PersonalJarvis-macOS-x64.dmg"},
+ "linux": {"Dodaios-Linux-x86_64.AppImage", "PersonalJarvis-Linux-x86_64.AppImage"},
+ "windows": {"Dodaios-Setup-x64.exe", "PersonalJarvis-Setup-x64.exe"},
+ "macos": {
+ "Dodaios-macOS-arm64.dmg",
+ "Dodaios-macOS-x64.dmg",
+ "PersonalJarvis-macOS-arm64.dmg",
+ "PersonalJarvis-macOS-x64.dmg",
+ },
}
-DEB_PATTERN = re.compile(r"personal-jarvis_[0-9.]+_amd64\.deb")
+# The optional Debian package is named after its package: the earlier name
+# until the package itself is renamed, the current one after.
+DEB_PATTERN = re.compile(r"(?:dodaios|personal-jarvis)_[0-9.]+_amd64\.deb")
+#: The source archive under its current name and the name earlier installers
+#: fall back to; both are published.
+SOURCE_ARCHIVES = (
+ ("dodaios-src.tar.gz", "dodaios/"),
+ ("personal-jarvis-src.tar.gz", "personal-jarvis/"),
+)
DESKTOP_WORKFLOW = ".github/workflows/desktop-installers.yml"
@@ -119,9 +139,7 @@ def staged_assets(directory: Path, profile: str) -> dict[str, Path]:
required = DESKTOP_ASSETS if profile == "desktop" else SIGNING_ASSETS
files = {}
for path in directory.rglob("*"):
- optional_deb = profile == "desktop" and re.fullmatch(
- r"personal-jarvis_[0-9.]+_amd64\.deb", path.name
- )
+ optional_deb = profile == "desktop" and DEB_PATTERN.fullmatch(path.name)
if path.name not in required and not optional_deb:
continue
if path.is_symlink() or not path.is_file() or path.stat().st_size == 0:
@@ -288,9 +306,20 @@ def asset_errors(assets: list[dict], manifests: dict[str, str]) -> list[str]:
errors.append(f"release asset checksum mismatch: {name}")
if required - digests.keys():
errors.append(f"incomplete manifest: {manifest}")
+ if manifest == "installers-SHA256SUMS.txt":
+ errors.extend(alias_errors(digests))
return errors
+def alias_errors(digests: dict[str, str]) -> list[str]:
+ """Both names of one installer must carry the same bytes."""
+ return [
+ f"installer names differ in content: {current} and {earlier}"
+ for current, earlier in INSTALLER_NAME_PAIRS
+ if current in digests and earlier in digests and digests[current] != digests[earlier]
+ ]
+
+
def finalize(repo: str, tag: str, sha: str, wait_minutes: int) -> int:
deadline = time.monotonic() + wait_minutes * 60
while True:
@@ -338,22 +367,28 @@ def finalize(repo: str, tag: str, sha: str, wait_minutes: int) -> int:
errors.append("signed payload commit does not match the release commit")
if errors:
raise ValueError("; ".join(errors))
- archive = folder / "personal-jarvis-src.tar.gz"
- run_command(
- [
- "git",
- "archive",
- "--format=tar.gz",
- "--prefix=personal-jarvis/",
- "-o",
- str(archive),
- f"refs/tags/{tag}",
- ]
- )
+ archives = []
+ for name, prefix in SOURCE_ARCHIVES:
+ archive = folder / name
+ run_command(
+ [
+ "git",
+ "archive",
+ "--format=tar.gz",
+ f"--prefix={prefix}",
+ "-o",
+ str(archive),
+ f"refs/tags/{tag}",
+ ]
+ )
+ archives.append(archive)
checksum = folder / "source-SHA256SUMS.txt"
- with archive.open("rb") as stream:
- digest = hashlib.file_digest(stream, "sha256").hexdigest()
- checksum.write_text(f"{digest} {archive.name}\n", encoding="utf-8")
+ lines = []
+ for archive in archives:
+ with archive.open("rb") as stream:
+ digest = hashlib.file_digest(stream, "sha256").hexdigest()
+ lines.append(f"{digest} {archive.name}\n")
+ checksum.write_text("".join(lines), encoding="utf-8")
changelog = run_command(["git", "show", f"refs/tags/{tag}:CHANGELOG.md"]).stdout
from scripts.ci.cut_release import section_notes
@@ -367,14 +402,14 @@ def finalize(repo: str, tag: str, sha: str, wait_minutes: int) -> int:
tag,
"--repo",
repo,
- str(archive),
+ *(str(archive) for archive in archives),
str(checksum),
"--clobber",
]
)
uploaded = api_pages(f"repos/{repo}/releases/{info['databaseId']}/assets?per_page=100", "")
uploaded_by_name = {asset["name"]: asset for asset in uploaded}
- for file in (archive, checksum):
+ for file in (*archives, checksum):
with file.open("rb") as stream:
expected = "sha256:" + hashlib.file_digest(stream, "sha256").hexdigest()
if uploaded_by_name.get(file.name, {}).get("digest") != expected:
@@ -424,11 +459,11 @@ def published_errors(repo: str, tag: str) -> list[str]:
by_name = {asset["name"]: asset for asset in assets}
source, problems = parse_manifest(manifests["source-SHA256SUMS.txt"])
errors.extend(f"{problem} in source-SHA256SUMS.txt" for problem in problems)
- archive = "personal-jarvis-src.tar.gz"
- if archive not in source:
- errors.append("incomplete manifest: source-SHA256SUMS.txt")
- elif by_name.get(archive, {}).get("digest") != f"sha256:{source[archive]}":
- errors.append(f"release asset checksum mismatch: {archive}")
+ for archive, _prefix in SOURCE_ARCHIVES:
+ if archive not in source:
+ errors.append(f"incomplete manifest: source-SHA256SUMS.txt lacks {archive}")
+ elif by_name.get(archive, {}).get("digest") != f"sha256:{source[archive]}":
+ errors.append(f"release asset checksum mismatch: {archive}")
return errors
diff --git a/scripts/ci/silent-handlers-baseline.json b/scripts/ci/silent-handlers-baseline.json
index d1dfb60c21..a45fa15a2f 100644
--- a/scripts/ci/silent-handlers-baseline.json
+++ b/scripts/ci/silent-handlers-baseline.json
@@ -362,7 +362,7 @@
"dodaios/ui/relauncher.py": 11,
"dodaios/ui/shell/runtime_check.py": 3,
"dodaios/ui/shell/shell.py": 1,
- "dodaios/ui/shell/single_instance.py": 9,
+ "dodaios/ui/shell/single_instance.py": 7,
"dodaios/ui/tray.py": 3,
"dodaios/ui/web/agent_chat_routes.py": 3,
"dodaios/ui/web/agentic_ide_routes.py": 4,
diff --git a/scripts/cleanup_scratch.py b/scripts/cleanup_scratch.py
index 415d12e4de..34918552ac 100644
--- a/scripts/cleanup_scratch.py
+++ b/scripts/cleanup_scratch.py
@@ -88,7 +88,7 @@ HEAVY_DIRS = [
]
#: Live config and data a glob above might otherwise match.
-NEVER_TOUCH = {"jarvis.toml", "usage.db", "jarvis.toml.example", "mcp.json"}
+NEVER_TOUCH = {"jarvis.toml", "dodaios.toml", "usage.db", "jarvis.toml.example", "mcp.json"}
def human(num_bytes: int) -> str:
diff --git a/scripts/install_shortcuts.py b/scripts/install_shortcuts.py
index ca76909ce3..34442bbd7d 100644
--- a/scripts/install_shortcuts.py
+++ b/scripts/install_shortcuts.py
@@ -6,8 +6,8 @@ Run once:
Result:
1. assets/icons/jarvis.ico — multi-size Windows icon (black + signal yellow)
- 2. Desktop\\Personal Jarvis.lnk — double-click opens the window
- 3. shell:startup\\Personal Jarvis.lnk — starts Jarvis at Windows login
+ 2. Desktop\\Dodaios.lnk — double-click opens the window
+ 3. shell:startup\\Dodaios.lnk — starts Jarvis at Windows login
Both shortcuts point to run.bat in the project folder. run.bat uses
pythonw.exe, so no console window pops up.
@@ -17,7 +17,7 @@ Dev instance (a second, freely restartable desktop app — see
python scripts/install_shortcuts.py --dev
- → Desktop\\Personal Jarvis Dev.lnk (DEV-badged icon, ``--instance dev``);
+ → Desktop\\Dodaios Dev.lnk (DEV-badged icon, ``--instance dev``);
never touches autostart.
Uninstall:
@@ -336,7 +336,7 @@ def main() -> int:
"--dev",
action="store_true",
help=(
- "Create the 'Personal Jarvis Dev' desktop shortcut (second, restartable "
+ "Create the 'Dodaios Dev' desktop shortcut (second, restartable "
"instance) instead of the regular one; never touches autostart"
),
)
diff --git a/tests/conftest.py b/tests/conftest.py
index cf570acdd3..fabceb24ff 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -24,6 +24,18 @@ def pytest_configure(config) -> None: # noqa: ANN001
)
[email protected](autouse=True)
+def _not_the_main_instance(monkeypatch): # noqa: ANN001
+ """No test inherits the desktop app's main-instance flag.
+
+ A test run launched from a pane inside the running app inherits
+ ``JARVIS_PRIMARY_INSTANCE=1``. A server started under it would schedule
+ main-instance-only background work, such as the credential copy against
+ the developer's real OS keyring. A test that needs the flag sets it itself.
+ """
+ monkeypatch.delenv("JARVIS_PRIMARY_INSTANCE", raising=False)
+
+
@pytest.fixture(autouse=True)
def _society_runtime_isolated():
"""Put the process-wide society runtime back after every test.
diff --git a/tests/fakes/fake_keychain_vault.py b/tests/fakes/fake_keychain_vault.py
new file mode 100644
index 0000000000..e027542081
--- /dev/null
+++ b/tests/fakes/fake_keychain_vault.py
@@ -0,0 +1,72 @@
+"""Stand-ins for the macOS vault wrapper's two dependencies.
+
+``DarwinBundleKeyringBackend`` (``dodaios.core.keychain_bundle``) keeps every
+key in one vault item, read and written through the ``security`` CLI, and
+falls back to the per-item platform backend. These fakes hold both in dicts
+and record every call, so a test can prove which service was written. No
+real Keychain and no ``security`` process is ever involved.
+"""
+
+from __future__ import annotations
+
+import base64
+import json
+
+from keyring.errors import PasswordDeleteError
+
+
+def vault_payload(entries: dict[str, str]) -> str:
+ """A vault item as the ``security`` CLI stores it: base64 of the JSON object."""
+ return base64.b64encode(json.dumps(entries).encode("utf-8")).decode("ascii")
+
+
+def read_payload(raw: str) -> dict[str, str]:
+ return json.loads(base64.b64decode(raw).decode("utf-8"))
+
+
+class FakeSecurityCli:
+ """In-memory ``security`` CLI vault store: ``(service, account) -> payload``."""
+
+ def __init__(self) -> None:
+ self.items: dict[tuple[str, str], str] = {}
+ self.calls: list[tuple[str, str, str]] = []
+
+ def read(self, service: str, account: str) -> str | None:
+ self.calls.append(("read", service, account))
+ return self.items.get((service, account))
+
+ def write(self, service: str, account: str, value: str) -> None:
+ self.calls.append(("write", service, account))
+ self.items[(service, account)] = value
+
+ def delete(self, service: str, account: str) -> None:
+ self.calls.append(("delete", service, account))
+ self.items.pop((service, account), None)
+
+ def writes(self, service: str) -> list[str]:
+ return [account for op, owner, account in self.calls if owner == service and op != "read"]
+
+
+class FakePerItemKeychain:
+ """The per-item backend the wrapper falls back to (one entry per key)."""
+
+ def __init__(self) -> None:
+ self.values: dict[tuple[str, str], str] = {}
+ self.calls: list[tuple[str, str, str]] = []
+
+ def get_password(self, service: str, key: str) -> str | None:
+ self.calls.append(("get", service, key))
+ return self.values.get((service, key))
+
+ def set_password(self, service: str, key: str, value: str) -> None:
+ self.calls.append(("set", service, key))
+ self.values[(service, key)] = value
+
+ def delete_password(self, service: str, key: str) -> None:
+ self.calls.append(("delete", service, key))
+ if (service, key) not in self.values:
+ raise PasswordDeleteError(f"no item {key!r} under {service!r}")
+ del self.values[(service, key)]
+
+ def writes(self, service: str) -> list[str]:
+ return [key for op, owner, key in self.calls if owner == service and op != "get"]
diff --git a/tests/fakes/fake_platform_keyring.py b/tests/fakes/fake_platform_keyring.py
new file mode 100644
index 0000000000..9c6c570fea
--- /dev/null
+++ b/tests/fakes/fake_platform_keyring.py
@@ -0,0 +1,45 @@
+"""An OS credential store stand-in that ``keyring.set_keyring`` accepts.
+
+``dodaios.core.config`` talks to the process-wide ``keyring`` module, which
+only takes a ``keyring.backend.KeyringBackend``. This one keeps entries under
+``(service, key)`` in a dict, records every call, and behaves like the real
+backends the app relies on: a read of a missing entry is ``None``, a delete of
+one raises ``PasswordDeleteError``. Nothing here reaches a real keyring.
+"""
+
+from __future__ import annotations
+
+import keyring.backend
+from keyring.errors import PasswordDeleteError
+
+
+class FakePlatformKeyring(keyring.backend.KeyringBackend):
+ """A dict-backed platform keyring with a positive priority."""
+
+ priority = 5 # type: ignore[assignment] # a real OS backend, not fail.Keyring
+
+ def __init__(self) -> None:
+ super().__init__()
+ self.entries: dict[tuple[str, str], str] = {}
+ self.calls: list[tuple[str, str, str]] = []
+
+ def get_password(self, service: str, username: str) -> str | None:
+ self.calls.append(("get", service, username))
+ return self.entries.get((service, username))
+
+ def set_password(self, service: str, username: str, password: str) -> None:
+ self.calls.append(("set", service, username))
+ self.entries[(service, username)] = password
+
+ def delete_password(self, service: str, username: str) -> None:
+ self.calls.append(("delete", service, username))
+ if (service, username) not in self.entries:
+ raise PasswordDeleteError(f"no entry {username!r} under {service!r}")
+ del self.entries[(service, username)]
+
+ def writes(self, service: str) -> list[str]:
+ """The keys written or deleted under ``service``, in call order."""
+ return [key for op, owner, key in self.calls if owner == service and op != "get"]
+
+ def service(self, service: str) -> dict[str, str]:
+ return {key: value for (owner, key), value in self.entries.items() if owner == service}
diff --git a/tests/fakes/fake_win32_mutex.py b/tests/fakes/fake_win32_mutex.py
new file mode 100644
index 0000000000..9dc281eb89
--- /dev/null
+++ b/tests/fakes/fake_win32_mutex.py
@@ -0,0 +1,86 @@
+"""Hand-built stand-in for the pywin32 named-mutex calls.
+
+Per AGENTS.md the project uses real fakes, never ``unittest.mock``. A real
+named mutex is machine-wide (``Global\\...``): a test that created the app's own
+name would make the developer's running app look like a secondary, or the
+other way round. :class:`FakeNamedMutexes` keeps the namespace in memory and
+hands out three module stand-ins (``win32event``, ``win32api``, ``winerror``)
+plus a ``last_error`` function, the way ``dodaios.ui.shell.single_instance``
+reads them.
+
+Install with :meth:`FakeNamedMutexes.install`, which uses ``monkeypatch`` so
+every module is put back after the test.
+"""
+
+from __future__ import annotations
+
+import sys
+import types
+from collections import Counter
+
+import pytest
+
+ERROR_ALREADY_EXISTS = 183
+
+
+class FakeNamedMutexes:
+ """A per-test mutex namespace: create, release and close by handle.
+
+ ``held`` counts the open handles per name, the way the kernel keeps a named
+ object alive while any handle to it is open. ``created`` lists every
+ ``CreateMutex`` call in order, ``closed`` every name whose handle closed.
+ """
+
+ def __init__(self, *, held_elsewhere: tuple[str, ...] = ()) -> None:
+ self.held: Counter[str] = Counter(held_elsewhere)
+ self.created: list[str] = []
+ self.closed: list[str] = []
+ self._names_by_handle: dict[int, str] = {}
+ self._next_handle = 100
+ self._last_error = 0
+
+ # -- win32event ---------------------------------------------------------
+ def CreateMutex(self, _security: object, _initial_owner: bool, name: str) -> int: # noqa: N802
+ self.created.append(name)
+ self._last_error = ERROR_ALREADY_EXISTS if self.held[name] else 0
+ self.held[name] += 1
+ handle = self._next_handle
+ self._next_handle += 1
+ self._names_by_handle[handle] = name
+ return handle
+
+ def ReleaseMutex(self, handle: int) -> None: # noqa: N802
+ if handle not in self._names_by_handle:
+ raise OSError("not a mutex handle")
+
+ # -- win32api -----------------------------------------------------------
+ def CloseHandle(self, handle: int) -> None: # noqa: N802
+ name = self._names_by_handle.pop(handle)
+ self.held[name] -= 1
+ if self.held[name] <= 0:
+ del self.held[name]
+ self.closed.append(name)
+
+ # -- kernel32.GetLastError ---------------------------------------------
+ def last_error(self) -> int:
+ return self._last_error
+
+ def is_held(self, name: str) -> bool:
+ return self.held[name] > 0
+
+ def install(self, monkeypatch: pytest.MonkeyPatch, module: types.ModuleType) -> None:
+ """Put the stand-ins where ``module`` imports and reads them."""
+ win32event = types.ModuleType("win32event")
+ win32event.CreateMutex = self.CreateMutex # type: ignore[attr-defined]
+ win32event.ReleaseMutex = self.ReleaseMutex # type: ignore[attr-defined]
+ win32api = types.ModuleType("win32api")
+ win32api.CloseHandle = self.CloseHandle # type: ignore[attr-defined]
+ winerror = types.ModuleType("winerror")
+ winerror.ERROR_ALREADY_EXISTS = ERROR_ALREADY_EXISTS # type: ignore[attr-defined]
+ for name, stand_in in (
+ ("win32event", win32event),
+ ("win32api", win32api),
+ ("winerror", winerror),
+ ):
+ monkeypatch.setitem(sys.modules, name, stand_in)
+ monkeypatch.setattr(module, "_get_last_error", self.last_error)
diff --git a/tests/fakes/fake_windows_shortcuts.py b/tests/fakes/fake_windows_shortcuts.py
new file mode 100644
index 0000000000..2e801b7769
--- /dev/null
+++ b/tests/fakes/fake_windows_shortcuts.py
@@ -0,0 +1,69 @@
+"""Hand-built stand-in for the Windows shell shortcuts the app writes and reads.
+
+Per AGENTS.md the project uses real fakes, never ``unittest.mock``. A real
+``.lnk`` needs ``WScript.Shell`` and lands where the shell indexes it; this
+fake writes a plain file whose only content is the target path, so a test can
+lay out a Start menu and a Desktop in ``tmp_path`` (earlier-named shortcuts of
+this install, of another install, unreadable ones) and see what the code under
+test writes, reads and removes.
+
+:meth:`FakeShortcuts.install` replaces the ``dodaios.ui.icon_utils`` writers
+``dodaios.setup.desktop_integration`` calls, plus its Installed Apps registry
+writer, so nothing reaches the real shell or registry.
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+
+
+class FakeShortcuts:
+ """Shortcut files keyed by path; each one names the program it starts."""
+
+ def __init__(self, *, launch_target: Path, shortcut_name: str) -> None:
+ self.launch_target = launch_target
+ self.shortcut_name = shortcut_name
+ self.written: list[Path] = []
+ self.read: list[Path] = []
+ self.unreadable: set[Path] = set()
+
+ @staticmethod
+ def place(lnk: Path, target: Path | str) -> Path:
+ """Put a shortcut at ``lnk`` that starts ``target`` (an earlier release's)."""
+ lnk.parent.mkdir(parents=True, exist_ok=True)
+ lnk.write_text(str(target), encoding="utf-8")
+ return lnk
+
+ def read_target(self, lnk: Path) -> str | None:
+ self.read.append(lnk)
+ if lnk in self.unreadable:
+ return None
+ return lnk.read_text(encoding="utf-8")
+
+ def _write(self, directory: Path | None) -> bool:
+ if directory is None:
+ return False
+ lnk = self.place(directory / self.shortcut_name, self.launch_target)
+ self.written.append(lnk)
+ return True
+
+ def install(self, monkeypatch: pytest.MonkeyPatch) -> None:
+ from dodaios.setup import desktop_integration
+ from dodaios.ui import icon_utils
+
+ def ensure_start_menu_shortcut(*, programs_dir: Path | None = None, **_kw: object) -> bool:
+ return self._write(programs_dir)
+
+ def ensure_desktop_shortcut(*, desktop_dir: Path | None = None, **_kw: object) -> bool:
+ return self._write(desktop_dir)
+
+ monkeypatch.setattr(icon_utils, "ensure_start_menu_shortcut", ensure_start_menu_shortcut)
+ monkeypatch.setattr(icon_utils, "ensure_desktop_shortcut", ensure_desktop_shortcut)
+ monkeypatch.setattr(
+ icon_utils, "register_windows_app_user_model_id", lambda *_a, **_kw: True
+ )
+ monkeypatch.setattr(
+ desktop_integration, "register_windows_installed_app", lambda *_a, **_kw: True
+ )
diff --git a/tests/integration/test_update_handover_real_os.py b/tests/integration/test_update_handover_real_os.py
index 3e15b5f78e..3b7ce48a57 100644
--- a/tests/integration/test_update_handover_real_os.py
+++ b/tests/integration/test_update_handover_real_os.py
@@ -30,6 +30,7 @@ from pathlib import Path
import pytest
import dodaios.core.installer_update as iu
+from dodaios.core.branding import WINDOWS_BRANDED_LAUNCHER_FILE_NAME
from dodaios.core.installer_update import (
SubprocessCommandRunner,
apply_installer,
@@ -309,6 +310,10 @@ def _uninstall_key_exists() -> bool:
def _build_setup(iscc: Path, fake_exe: Path, version: str, work: Path) -> Path:
source = work / f"src-{version}"
source.mkdir()
+ # The frozen bundle ships the launcher under its current name and, for pins
+ # and logon tasks from before the rename, under its earlier one; Setup
+ # relaunches the current one.
+ shutil.copy2(fake_exe, source / WINDOWS_BRANDED_LAUNCHER_FILE_NAME)
shutil.copy2(fake_exe, source / "PersonalJarvis.exe")
(source / "version.txt").write_text(version, encoding="utf-8")
out = work / f"out-{version}"
diff --git a/tests/unit/autostart/test_linux.py b/tests/unit/autostart/test_linux.py
index 66a0320927..9ec078c8f6 100644
--- a/tests/unit/autostart/test_linux.py
+++ b/tests/unit/autostart/test_linux.py
@@ -6,9 +6,13 @@ from pathlib import Path
import pytest
-from dodaios.autostart.linux import LinuxAutostart
+from dodaios.autostart.linux import LinuxAutostart, entry_belongs_to_install
from dodaios.autostart.protocol import LaunchSpec
-from dodaios.core.desktop_entry import escape_value
+from dodaios.core.branding import (
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LINUX_DESKTOP_ENTRY_FILE_NAME,
+)
+from dodaios.core.desktop_entry import escape_value, exec_value
def _spec(
@@ -28,7 +32,7 @@ def test_install_writes_desktop_entry(monkeypatch, tmp_path: Path) -> None:
mgr = LinuxAutostart()
status = mgr.install(_spec())
- entry = tmp_path / "autostart" / "personal-jarvis.desktop"
+ entry = tmp_path / "autostart" / "dodaios.desktop"
assert entry.exists()
text = entry.read_text(encoding="utf-8")
assert "[Desktop Entry]" in text
@@ -45,7 +49,7 @@ def test_install_brands_entry_with_icon_and_wmclass(monkeypatch, tmp_path: Path)
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
LinuxAutostart().install(_spec())
- text = (tmp_path / "autostart" / "personal-jarvis.desktop").read_text(encoding="utf-8")
+ text = (tmp_path / "autostart" / "dodaios.desktop").read_text(encoding="utf-8")
png = bundled_app_icon_png()
assert png is not None, "bundled jarvis.png must ship for the Linux Icon= key"
@@ -53,7 +57,7 @@ def test_install_brands_entry_with_icon_and_wmclass(monkeypatch, tmp_path: Path)
# is the identity for an icon path; on a Windows dev/CI host the bundled
# path carries backslashes, and NOT escaping them would be the bug.
assert f"Icon={escape_value(str(png))}" in text
- assert "StartupWMClass=personal-jarvis" in text
+ assert "StartupWMClass=dodaios" in text
def test_status_detects_path_drift(monkeypatch, tmp_path: Path) -> None:
@@ -72,7 +76,7 @@ def test_program_with_spaces_is_quoted(monkeypatch, tmp_path: Path) -> None:
mgr = LinuxAutostart()
spec = _spec(program="/opt/My Apps/python3")
mgr.install(spec)
- text = (tmp_path / "autostart" / "personal-jarvis.desktop").read_text(encoding="utf-8")
+ text = (tmp_path / "autostart" / "dodaios.desktop").read_text(encoding="utf-8")
assert 'Exec="/opt/My Apps/python3" -m dodaios.ui.web.launcher' in text
# And the round-trip still matches.
assert mgr.status(spec).matches_spec is True
@@ -83,7 +87,7 @@ def test_uninstall_removes_entry(monkeypatch, tmp_path: Path) -> None:
mgr = LinuxAutostart()
mgr.install(_spec())
status = mgr.uninstall()
- assert not (tmp_path / "autostart" / "personal-jarvis.desktop").exists()
+ assert not (tmp_path / "autostart" / "dodaios.desktop").exists()
assert status.installed is False
@@ -98,7 +102,7 @@ def test_status_supported_even_when_absent(monkeypatch, tmp_path: Path) -> None:
def _entry_text(tmp_path: Path) -> str:
- return (tmp_path / "autostart" / "personal-jarvis.desktop").read_text(
+ return (tmp_path / "autostart" / "dodaios.desktop").read_text(
encoding="utf-8"
)
@@ -168,7 +172,7 @@ def test_status_reports_drift_when_gnome_switched_the_entry_off(
mgr = LinuxAutostart()
spec = _spec()
mgr.install(spec)
- entry = tmp_path / "autostart" / "personal-jarvis.desktop"
+ entry = tmp_path / "autostart" / "dodaios.desktop"
entry.write_text(
_entry_text(tmp_path).replace(
"X-GNOME-Autostart-enabled=true", "X-GNOME-Autostart-enabled=false"
@@ -188,7 +192,7 @@ def test_status_reports_drift_for_a_hidden_entry(monkeypatch, tmp_path: Path) ->
mgr = LinuxAutostart()
spec = _spec()
mgr.install(spec)
- entry = tmp_path / "autostart" / "personal-jarvis.desktop"
+ entry = tmp_path / "autostart" / "dodaios.desktop"
entry.write_text(
_entry_text(tmp_path).replace("Hidden=false", "Hidden=true"), encoding="utf-8"
)
@@ -206,7 +210,7 @@ def test_status_ignores_an_exec_from_another_group(monkeypatch, tmp_path: Path)
mgr = LinuxAutostart()
spec = _spec()
mgr.install(spec)
- entry = tmp_path / "autostart" / "personal-jarvis.desktop"
+ entry = tmp_path / "autostart" / "dodaios.desktop"
entry.write_text(
_entry_text(tmp_path)
+ "\n[Desktop Action new-window]\nExec=/somewhere/else --new\n",
@@ -223,7 +227,7 @@ def test_status_tolerates_spaces_around_the_equals_sign(
mgr = LinuxAutostart()
spec = _spec()
mgr.install(spec)
- entry = tmp_path / "autostart" / "personal-jarvis.desktop"
+ entry = tmp_path / "autostart" / "dodaios.desktop"
entry.write_text(
_entry_text(tmp_path).replace("Path=", "Path = "), encoding="utf-8"
)
@@ -248,9 +252,9 @@ def test_relative_xdg_config_home_is_ignored(monkeypatch, tmp_path: Path) -> Non
status = LinuxAutostart().install(_spec())
- assert (home / ".config" / "autostart" / "personal-jarvis.desktop").exists()
+ assert (home / ".config" / "autostart" / "dodaios.desktop").exists()
assert status.entry_path == str(
- home / ".config" / "autostart" / "personal-jarvis.desktop"
+ home / ".config" / "autostart" / "dodaios.desktop"
)
@@ -260,7 +264,7 @@ def test_relative_xdg_config_home_is_ignored(monkeypatch, tmp_path: Path) -> Non
def test_failed_install_leaves_no_temp_file_behind(monkeypatch, tmp_path: Path) -> None:
"""The successful replace() consumes the temp file — debris means a failure.
- A stray ``personal-jarvis.desktop.tmp`` next to the real entry is confusing
+ A stray ``dodaios.desktop.tmp`` next to the real entry is confusing
at best; the macOS LaunchAgent writer already cleaned up after itself.
"""
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
@@ -273,7 +277,7 @@ def test_failed_install_leaves_no_temp_file_behind(monkeypatch, tmp_path: Path)
with pytest.raises(OSError, match="simulated read-only home"):
mgr.install(_spec())
- assert not (tmp_path / "autostart" / "personal-jarvis.desktop.tmp").exists()
+ assert not (tmp_path / "autostart" / "dodaios.desktop.tmp").exists()
def test_uninstall_reports_honestly_when_the_entry_survives(
@@ -298,17 +302,158 @@ def test_uninstall_reports_honestly_when_the_entry_survives(
assert status.installed is True
assert status.matches_spec is False
assert "could not be removed" in status.detail
- assert (tmp_path / "autostart" / "personal-jarvis.desktop").exists()
+ assert (tmp_path / "autostart" / "dodaios.desktop").exists()
def test_uninstall_cleans_up_leftover_temp_debris(monkeypatch, tmp_path: Path) -> None:
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
mgr = LinuxAutostart()
mgr.install(_spec())
- debris = tmp_path / "autostart" / "personal-jarvis.desktop.tmp"
+ debris = tmp_path / "autostart" / "dodaios.desktop.tmp"
debris.write_text("half written", encoding="utf-8")
status = mgr.uninstall()
assert not debris.exists()
assert status.installed is False
+
+
+# ---- The entry under its earlier name ---------------------------------------
+
+_LEGACY_NAME = LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES[0]
+
+
+def _write_legacy(tmp_path: Path, spec: LaunchSpec, *, extra: str = "") -> Path:
+ """An entry exactly as an earlier release wrote it, under the earlier name."""
+ entry = tmp_path / "autostart" / _LEGACY_NAME
+ entry.parent.mkdir(parents=True, exist_ok=True)
+ entry.write_text(
+ "[Desktop Entry]\n"
+ "Type=Application\n"
+ "Name=Personal Jarvis\n"
+ f"Exec={exec_value(spec.program, spec.args)}\n"
+ f"Path={escape_value(spec.working_dir)}\n"
+ "StartupWMClass=personal-jarvis\n"
+ "X-GNOME-Autostart-enabled=true\n"
+ f"{extra}",
+ encoding="utf-8",
+ )
+ return entry
+
+
+def test_the_entry_names_follow_the_branding() -> None:
+ assert LINUX_DESKTOP_ENTRY_FILE_NAME == "dodaios.desktop"
+ assert _LEGACY_NAME == "personal-jarvis.desktop"
+
+
+def test_an_earlier_named_entry_that_starts_this_install_counts_as_current(
+ monkeypatch, tmp_path: Path
+) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ legacy = _write_legacy(tmp_path, _spec())
+
+ status = LinuxAutostart().status(_spec())
+
+ # Like a logon task under its earlier name on Windows: the boot reconcile
+ # sees a current entry and leaves the working one alone.
+ assert status.installed is True
+ assert status.matches_spec is True
+ assert status.entry_path == str(legacy)
+ assert not (tmp_path / "autostart" / LINUX_DESKTOP_ENTRY_FILE_NAME).exists()
+
+
+def test_an_earlier_named_entry_with_an_old_command_is_stale_and_replaced(
+ monkeypatch, tmp_path: Path
+) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ old_command = LaunchSpec(
+ program="/usr/bin/python3",
+ args=("-m", "jarvis.ui.web.launcher"),
+ working_dir=_spec().working_dir,
+ )
+ legacy = _write_legacy(tmp_path, old_command)
+ mgr = LinuxAutostart()
+
+ assert mgr.status(_spec()).matches_spec is False
+ status = mgr.install(_spec())
+
+ # One entry starts the app at login, under the current name.
+ assert status.matches_spec is True
+ assert status.entry_path == str(tmp_path / "autostart" / LINUX_DESKTOP_ENTRY_FILE_NAME)
+ assert not legacy.exists()
+
+
+def test_writing_the_entry_removes_the_earlier_one_of_this_install(
+ monkeypatch, tmp_path: Path
+) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ legacy = _write_legacy(tmp_path, _spec())
+
+ LinuxAutostart().install(_spec())
+
+ assert not legacy.exists()
+ text = _entry_text(tmp_path)
+ assert "Name=Dodaios" in text
+ assert "StartupWMClass=dodaios" in text
+
+
+def test_an_earlier_named_entry_of_another_install_is_never_touched(
+ monkeypatch, tmp_path: Path
+) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ other = _write_legacy(
+ tmp_path, _spec(program="/home/u/other/.venv/bin/python", working_dir="/home/u/other")
+ )
+ mgr = LinuxAutostart(install_dir=_spec().working_dir)
+
+ # It is not this install's entry, so it neither counts as ours ...
+ assert mgr.status(_spec()).installed is False
+ # ... nor goes when this install writes or removes its own.
+ mgr.install(_spec())
+ mgr.uninstall()
+ assert other.exists()
+
+
+def test_both_entries_of_one_install_are_not_current(monkeypatch, tmp_path: Path) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ mgr = LinuxAutostart()
+ mgr.install(_spec())
+ legacy = _write_legacy(tmp_path, _spec())
+
+ # Two entries start the app twice at login: the reconcile must run install().
+ status = mgr.status(_spec())
+ assert status.matches_spec is False
+ assert "earlier name" in status.detail
+ assert mgr.install(_spec()).matches_spec is True
+ assert not legacy.exists()
+
+
+def test_uninstall_removes_the_earlier_named_entry_of_this_install(
+ monkeypatch, tmp_path: Path
+) -> None:
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path))
+ legacy = _write_legacy(tmp_path, _spec())
+
+ status = LinuxAutostart(install_dir=_spec().working_dir).uninstall()
+
+ assert status.installed is False
+ assert not legacy.exists()
+
+
+def test_an_entry_belongs_to_the_install_its_venv_program_lives_in(tmp_path: Path) -> None:
+ install = tmp_path / "install"
+ python = install / ".venv" / "bin" / "python"
+ python.parent.mkdir(parents=True)
+ python.write_bytes(b"")
+ text = f"[Desktop Entry]\nExec={exec_value(str(python), ('-m', 'x'))}\n"
+
+ assert entry_belongs_to_install(text, str(install))
+ # The working folder alone decides as well; the shared system python does not.
+ assert entry_belongs_to_install(
+ f"[Desktop Entry]\nExec=/usr/bin/python3\nPath={escape_value(str(install))}\n",
+ str(install),
+ )
+ assert not entry_belongs_to_install(
+ "[Desktop Entry]\nExec=/usr/bin/python3 -m x\nPath=/elsewhere\n", str(install)
+ )
+ assert not entry_belongs_to_install("", str(install))
diff --git a/tests/unit/autostart/test_macos.py b/tests/unit/autostart/test_macos.py
index a6becbb143..f06d72caa5 100644
--- a/tests/unit/autostart/test_macos.py
+++ b/tests/unit/autostart/test_macos.py
@@ -171,3 +171,26 @@ def test_an_unreadable_login_item_does_not_fail_the_move(monkeypatch, tmp_path:
(tmp_path / "com.personal-jarvis.autostart.plist").write_bytes(b"not a plist")
assert macos.retarget_launch_agent(_bundle(_NEW_APP)) is False
+
+
+def test_a_renamed_app_takes_its_login_item_along_under_the_same_label(
+ monkeypatch, tmp_path: Path
+) -> None:
+ """The bundle's name moved, the LaunchAgent's label did not: the entry
+ written for the earlier name is rewritten in place, file name and all."""
+ from dodaios.core.branding import MACOS_APP_DIR_NAME, MACOS_AUTOSTART_LABEL
+
+ monkeypatch.setattr(macos, "_agents_dir", lambda: tmp_path)
+ MacOSAutostart().install(_spec())
+ renamed = f"/Users/u/Applications/{MACOS_APP_DIR_NAME}"
+
+ assert macos.retarget_launch_agent(_bundle(renamed)) is True
+
+ assert [p.name for p in tmp_path.iterdir()] == [f"{MACOS_AUTOSTART_LABEL}.plist"]
+ assert MACOS_AUTOSTART_LABEL == "com.personal-jarvis.autostart"
+ with (tmp_path / f"{MACOS_AUTOSTART_LABEL}.plist").open("rb") as fh:
+ data = plistlib.load(fh)
+ assert data["Label"] == MACOS_AUTOSTART_LABEL
+ assert data["ProgramArguments"] == ["/usr/bin/open", "-W", "-a", renamed]
+ # And back, for a rollback to a revision that knows only the earlier name.
+ assert macos.retarget_launch_agent(_bundle(_OLD_APP)) is True
diff --git a/tests/unit/autostart/test_moved_install_paths.py b/tests/unit/autostart/test_moved_install_paths.py
new file mode 100644
index 0000000000..f02f05e66d
--- /dev/null
+++ b/tests/unit/autostart/test_moved_install_paths.py
@@ -0,0 +1,221 @@
+"""An autostart entry written before the install folder moved still counts as current.
+
+The move leaves a link (a junction on Windows, a symlink elsewhere) at the
+earlier path, so an entry that names the interpreter and working folder by
+that path still starts this install. Judged by its text alone it looked like
+"a different install": on Windows the boot repair cannot rewrite the logon task
+without an elevation prompt, writes the startup shortcut instead, and the app
+then starts twice at every login. Real links on the real filesystem; the task
+and shortcut read-backs are the existing injected fakes.
+"""
+
+from __future__ import annotations
+
+import plistlib
+from pathlib import Path
+
+import pytest
+
+import dodaios.autostart.macos as macos
+from dodaios.autostart.linux import LinuxAutostart
+from dodaios.autostart.macos import MacOSAutostart
+from dodaios.autostart.paths import same_path
+from dodaios.autostart.protocol import LaunchSpec
+from dodaios.autostart.windows import TASK_NAME, WindowsAutostart, _TaskInfo
+from dodaios.core.branding import (
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LEGACY_WINDOWS_AUTOSTART_TASK_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LINUX_DESKTOP_ENTRY_FILE_NAME,
+ WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
+)
+from dodaios.core.identity_migration import create_directory_link
+
+ARGS = ("-m", "dodaios.ui.web.launcher")
+
+
+def _moved_install(tmp_path: Path) -> tuple[Path, Path]:
+ """``(current, legacy)``: the install folder and the link at its earlier name."""
+ current = tmp_path / ".dodaios"
+ for folder in ("Scripts", "bin"):
+ (current / ".venv" / folder).mkdir(parents=True)
+ (current / ".venv" / "Scripts" / "pythonw.exe").write_bytes(b"")
+ (current / ".venv" / "bin" / "python").write_bytes(b"")
+ legacy = tmp_path / ".personal-jarvis"
+ create_directory_link(legacy, current)
+ return current, legacy
+
+
+# --------------------------------------------------------------------------- #
+# The comparison #
+# --------------------------------------------------------------------------- #
+def test_same_path_matches_text_case_blind_on_windows_only() -> None:
+ assert same_path(r"C:\A\B", "c:/a/b", windows=True)
+ assert not same_path("/A/B", "/a/b")
+
+
+def test_same_path_matches_through_a_link(tmp_path: Path) -> None:
+ current, legacy = _moved_install(tmp_path)
+ python = Path(".venv") / "bin" / "python"
+ assert same_path(str(legacy / python), str(current / python))
+ assert same_path(str(legacy), str(current), windows=True)
+
+
+def test_same_path_never_matches_a_missing_path_by_identity(tmp_path: Path) -> None:
+ assert not same_path(str(tmp_path / "gone"), str(tmp_path))
+ assert same_path("", "")
+ assert not same_path("", str(tmp_path))
+
+
+# --------------------------------------------------------------------------- #
+# Windows: the logon task and the startup shortcut #
+# --------------------------------------------------------------------------- #
+def _windows(task: _TaskInfo | None, *, shortcut_present: bool = False, task_name: str = TASK_NAME):
+ """A manager whose only logon task is ``task``, registered as ``task_name``."""
+ calls: list[str] = []
+ manager = WindowsAutostart(
+ task_probe=lambda name: task if name == task_name else None,
+ run_elevated=lambda script: calls.append("elevate") or False,
+ shortcut_present=lambda: shortcut_present,
+ shortcut_matches=lambda spec: False,
+ write_shortcut=lambda spec: calls.append("write_shortcut"),
+ remove_shortcut=lambda: calls.append("remove_shortcut"),
+ )
+ return manager, calls
+
+
+def test_a_task_reached_through_the_earlier_folder_name_is_current(tmp_path: Path) -> None:
+ current, legacy = _moved_install(tmp_path)
+ spec = LaunchSpec(
+ program=str(current / ".venv" / "Scripts" / "pythonw.exe"),
+ args=ARGS,
+ working_dir=str(current),
+ )
+ task = _TaskInfo(
+ execute=str(legacy / ".venv" / "Scripts" / "pythonw.exe"),
+ arguments=" ".join(ARGS),
+ working_dir=str(legacy),
+ )
+ manager, calls = _windows(task)
+
+ assert manager.status(spec).matches_spec is True
+ # The boot repair (never interactive) leaves it alone: no second entry.
+ manager.install(spec, interactive=False)
+ assert "write_shortcut" not in calls
+ assert "elevate" not in calls
+
+
+def test_a_task_under_its_earlier_name_and_folder_name_is_current(tmp_path: Path) -> None:
+ # Both renames at once: the task an earlier release registered keeps its
+ # earlier name, starts the launcher under its earlier file name and the
+ # module under the earlier package, all through the link left at the
+ # earlier folder name. It still starts this install, so the boot repair
+ # neither asks for elevation nor writes a second entry.
+ current, legacy = _moved_install(tmp_path)
+ scripts = current / ".venv" / "Scripts"
+ (scripts / WINDOWS_BRANDED_LAUNCHER_FILE_NAME).write_bytes(b"")
+ earlier_launcher = LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]
+ (scripts / earlier_launcher).write_bytes(b"")
+ spec = LaunchSpec(
+ program=str(scripts / WINDOWS_BRANDED_LAUNCHER_FILE_NAME),
+ args=ARGS,
+ working_dir=str(current),
+ )
+ task = _TaskInfo(
+ execute=str(legacy / ".venv" / "Scripts" / earlier_launcher),
+ arguments="-m jarvis.ui.web.launcher",
+ working_dir=str(legacy),
+ )
+ earlier_task_name = LEGACY_WINDOWS_AUTOSTART_TASK_NAMES[0]
+ manager, calls = _windows(task, task_name=earlier_task_name)
+
+ status = manager.status(spec)
+ assert status.matches_spec is True
+ assert status.entry_path == f"Task Scheduler\\{earlier_task_name}"
+ manager.install(spec, interactive=False)
+ assert "write_shortcut" not in calls
+ assert "elevate" not in calls
+
+
+def test_a_task_pointing_at_another_folder_is_still_stale(tmp_path: Path) -> None:
+ current, _legacy = _moved_install(tmp_path)
+ other = tmp_path / "other"
+ (other / ".venv" / "Scripts").mkdir(parents=True)
+ (other / ".venv" / "Scripts" / "pythonw.exe").write_bytes(b"")
+ spec = LaunchSpec(
+ program=str(current / ".venv" / "Scripts" / "pythonw.exe"),
+ args=ARGS,
+ working_dir=str(current),
+ )
+ task = _TaskInfo(
+ execute=str(other / ".venv" / "Scripts" / "pythonw.exe"),
+ arguments=" ".join(ARGS),
+ working_dir=str(other),
+ )
+ manager, _calls = _windows(task)
+
+ assert manager.status(spec).matches_spec is False
+
+
+# --------------------------------------------------------------------------- #
+# macOS: the LaunchAgent #
+# --------------------------------------------------------------------------- #
+def test_a_launch_agent_written_from_the_earlier_folder_name_is_current(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ current, legacy = _moved_install(tmp_path)
+ agents = tmp_path / "LaunchAgents"
+ monkeypatch.setattr(macos, "_agents_dir", lambda: agents)
+ manager = MacOSAutostart()
+ bundle_args = ("-W", "-a", "/Users/u/Applications/Personal Jarvis.app")
+ manager.install(LaunchSpec("/usr/bin/open", bundle_args, str(legacy)))
+
+ now = LaunchSpec("/usr/bin/open", bundle_args, str(current))
+ assert manager.status(now).matches_spec is True
+
+ # Another folder is another install.
+ plist = next(agents.iterdir())
+ data = plistlib.loads(plist.read_bytes())
+ data["WorkingDirectory"] = str(tmp_path)
+ plist.write_bytes(plistlib.dumps(data))
+ assert manager.status(now).matches_spec is False
+
+
+# --------------------------------------------------------------------------- #
+# Linux: the XDG autostart entry #
+# --------------------------------------------------------------------------- #
+def test_a_desktop_entry_written_from_the_earlier_folder_name_is_current(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ current, legacy = _moved_install(tmp_path)
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config"))
+ manager = LinuxAutostart()
+ manager.install(LaunchSpec(str(legacy / ".venv" / "bin" / "python"), ARGS, str(legacy)))
+
+ now = LaunchSpec(str(current / ".venv" / "bin" / "python"), ARGS, str(current))
+ assert manager.status(now).matches_spec is True
+ # A different command in the same folder is a different entry.
+ other_args = LaunchSpec(now.program, (*ARGS, "--background-service"), now.working_dir)
+ assert manager.status(other_args).matches_spec is False
+
+
+def test_a_desktop_entry_under_its_earlier_name_and_folder_name_is_current(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ # Both renames at once: the entry an earlier release wrote, under the
+ # earlier file name, from the earlier folder name the link still leads to.
+ current, legacy = _moved_install(tmp_path)
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config"))
+ manager = LinuxAutostart()
+ manager.install(LaunchSpec(str(legacy / ".venv" / "bin" / "python"), ARGS, str(legacy)))
+ autostart = tmp_path / "config" / "autostart"
+ earlier = autostart / LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES[0]
+ (autostart / LINUX_DESKTOP_ENTRY_FILE_NAME).rename(earlier)
+
+ now = LaunchSpec(str(current / ".venv" / "bin" / "python"), ARGS, str(current))
+ status = manager.status(now)
+ assert status.matches_spec is True
+ assert status.entry_path == str(earlier)
+ # The uninstall of this install takes it away, found through the link.
+ assert LinuxAutostart(install_dir=str(current)).uninstall().installed is False
+ assert not earlier.exists()
diff --git a/tests/unit/autostart/test_windows_task.py b/tests/unit/autostart/test_windows_task.py
index 0c3f577766..704255a6eb 100644
--- a/tests/unit/autostart/test_windows_task.py
+++ b/tests/unit/autostart/test_windows_task.py
@@ -20,6 +20,8 @@ autostart still works (just possibly delayed) — covered by ``test_windows_scri
from __future__ import annotations
+import re
+
from dodaios.autostart.protocol import LaunchSpec
from dodaios.autostart.windows import (
TASK_NAME,
@@ -30,6 +32,12 @@ from dodaios.autostart.windows import (
build_unregister_task_script,
parse_task_query,
)
+from dodaios.core.branding import (
+ LEGACY_WINDOWS_AUTOSTART_TASK_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
+ WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
+)
_SPEC = LaunchSpec(
program=r"C:\Python\pythonw.exe",
@@ -191,6 +199,9 @@ def build_fake_query_output(
# --------------------------------------------------------------------------- #
+_LEGACY_TASK_NAME = LEGACY_WINDOWS_AUTOSTART_TASK_NAMES[0]
+
+
def _mk(
*,
task_info: _TaskInfo | None = None,
@@ -198,21 +209,56 @@ def _mk(
shortcut_present: bool = False,
shortcut_matches: bool = False,
) -> tuple[WindowsAutostart, list[str]]:
- calls: list[str] = []
- state = {"task": task_info, "shortcut": shortcut_present}
+ mgr, calls, _tasks, _probed = _scheduler(
+ task_info=task_info,
+ elevate_ok=elevate_ok,
+ shortcut_present=shortcut_present,
+ shortcut_matches=shortcut_matches,
+ )
+ return mgr, calls
- def task_probe() -> _TaskInfo | None:
- return state["task"]
+
+def _scheduler(
+ *,
+ task_info: _TaskInfo | None = None,
+ legacy_task_info: _TaskInfo | None = None,
+ elevate_ok: bool = True,
+ shortcut_present: bool = False,
+ shortcut_matches: bool = False,
+) -> tuple[WindowsAutostart, list[str], dict[str, _TaskInfo], list[str]]:
+ """A manager over an in-memory Task Scheduler keyed by task name.
+
+ Returns the manager, its side effects in order, the registered tasks by
+ name, and every name the manager asked the scheduler about.
+ """
+ calls: list[str] = []
+ tasks: dict[str, _TaskInfo] = {}
+ if task_info is not None:
+ tasks[TASK_NAME] = task_info
+ if legacy_task_info is not None:
+ tasks[_LEGACY_TASK_NAME] = legacy_task_info
+ probed: list[str] = []
+ state = {"shortcut": shortcut_present}
+
+ def task_probe(name: str) -> _TaskInfo | None:
+ probed.append(name)
+ return tasks.get(name)
def run_elevated(script: str) -> bool:
- if "Register-ScheduledTask" in script:
+ registered = re.findall(r"^ Register-ScheduledTask -TaskName '([^']+)'", script, re.M)
+ unregistered = re.findall(
+ r"^ Unregister-ScheduledTask -TaskName '([^']+)'", script, re.M
+ )
+ if registered:
calls.append("elevate_register")
- if elevate_ok:
- state["task"] = _MATCHING_INFO
- elif "Unregister-ScheduledTask" in script:
+ elif unregistered:
calls.append("elevate_unregister")
- if elevate_ok:
- state["task"] = None
+ calls.extend(f"unregister:{name}" for name in unregistered)
+ if elevate_ok:
+ for name in registered:
+ tasks[name] = _MATCHING_INFO
+ for name in unregistered:
+ tasks.pop(name, None)
return elevate_ok
def sc_present() -> bool:
@@ -237,7 +283,7 @@ def _mk(
write_shortcut=write_sc,
remove_shortcut=remove_sc,
)
- return mgr, calls
+ return mgr, calls, tasks, probed
def test_status_reports_scheduled_task_when_present_and_matching() -> None:
@@ -554,7 +600,7 @@ def test_boot_reconcile_writes_the_shortcut_without_powershell(monkeypatch, tmp_
"_write_shortcut_in_process",
lambda link, spec, icon: written.append((link, spec, icon)) or True,
)
- mgr = WindowsAutostart(task_probe=lambda: None, run_elevated=lambda s: False)
+ mgr = WindowsAutostart(task_probe=lambda name: None, run_elevated=lambda s: False)
mgr.install(_SPEC)
assert len(written) == 1
assert written[0][1] == _SPEC
@@ -580,7 +626,7 @@ def test_task_probe_uses_com_and_skips_powershell(monkeypatch) -> None:
monkeypatch.setattr(win_mod, "_run_powershell", _no_powershell)
monkeypatch.setattr(win_mod, "_query_task_in_process", lambda name: _MATCHING_INFO)
- assert WindowsAutostart()._default_task_probe() == _MATCHING_INFO
+ assert WindowsAutostart()._default_task_probe(TASK_NAME) == _MATCHING_INFO
def test_task_probe_com_failure_reads_as_absent_not_powershell(monkeypatch) -> None:
@@ -591,7 +637,7 @@ def test_task_probe_com_failure_reads_as_absent_not_powershell(monkeypatch) -> N
monkeypatch.setattr(win_mod, "_run_powershell", _no_powershell)
monkeypatch.setattr(win_mod, "_query_task_in_process", boom)
- assert WindowsAutostart()._default_task_probe() is None
+ assert WindowsAutostart()._default_task_probe(TASK_NAME) is None
def test_task_probe_without_pywin32_falls_back_to_powershell(monkeypatch) -> None:
@@ -605,4 +651,179 @@ def test_task_probe_without_pywin32_falls_back_to_powershell(monkeypatch) -> Non
"_run_powershell",
lambda script: subprocess.CompletedProcess(["powershell"], 0, stdout="", stderr=""),
)
- assert WindowsAutostart()._default_task_probe() is None
+ assert WindowsAutostart()._default_task_probe(TASK_NAME) is None
+
+
+# --------------------------------------------------------------------------- #
+# The task under the product's earlier name #
+# --------------------------------------------------------------------------- #
+
+
+def test_a_matching_task_under_the_earlier_name_counts_as_current() -> None:
+ mgr, calls, tasks, probed = _scheduler(legacy_task_info=_MATCHING_INFO)
+
+ st = mgr.status(_SPEC)
+ mgr.install(_SPEC, interactive=False)
+
+ assert st.installed is True and st.matches_spec is True
+ assert st.entry_path == f"Task Scheduler\\{_LEGACY_TASK_NAME}"
+ # The silent boot reconcile never elevates and writes no second entry.
+ assert calls == []
+ assert set(tasks) == {_LEGACY_TASK_NAME}
+ assert probed[:2] == [TASK_NAME, _LEGACY_TASK_NAME]
+
+
+def test_the_earlier_name_is_not_asked_for_once_the_task_moved() -> None:
+ mgr, _calls, _tasks, probed = _scheduler(
+ task_info=_MATCHING_INFO, legacy_task_info=_MATCHING_INFO
+ )
+
+ mgr.status(_SPEC)
+
+ assert probed == [TASK_NAME]
+
+
+def test_an_earlier_task_starting_the_earlier_launcher_and_package_still_matches(
+ tmp_path,
+) -> None:
+ # An earlier release registered {app}\PersonalJarvis.exe -m jarvis...; the
+ # install ships that file beside DodaiosApp.exe and the old module path
+ # resolves to the same module, so the task starts this install unchanged.
+ app = tmp_path / "Programs" / "Dodaios"
+ app.mkdir(parents=True)
+ legacy_exe = app / LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]
+ legacy_exe.write_bytes(b"MZ")
+ spec = LaunchSpec(
+ program=str(app / WINDOWS_BRANDED_LAUNCHER_FILE_NAME),
+ args=("-m", "dodaios.ui.web.launcher"),
+ working_dir=str(app),
+ )
+ old = _TaskInfo(
+ execute=str(legacy_exe),
+ arguments="-m jarvis.ui.web.launcher",
+ working_dir=str(app),
+ )
+ mgr, calls, _tasks, _probed = _scheduler(legacy_task_info=old)
+
+ assert mgr.status(spec).matches_spec is True
+ mgr.install(spec, interactive=False)
+ assert calls == []
+
+
+def test_an_earlier_launcher_name_that_is_gone_is_drift(tmp_path) -> None:
+ app = tmp_path / "app"
+ app.mkdir()
+ spec = LaunchSpec(
+ program=str(app / WINDOWS_BRANDED_LAUNCHER_FILE_NAME),
+ args=("-m", "dodaios.ui.web.launcher"),
+ working_dir=str(app),
+ )
+ old = _TaskInfo(
+ execute=str(app / LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]),
+ arguments="-m dodaios.ui.web.launcher",
+ working_dir=str(app),
+ )
+ mgr, _calls, _tasks, _probed = _scheduler(legacy_task_info=old)
+
+ assert mgr.status(spec).matches_spec is False
+
+
+def test_an_unrelated_executable_in_the_same_folder_is_drift(tmp_path) -> None:
+ app = tmp_path / "app"
+ app.mkdir()
+ (app / "other.exe").write_bytes(b"MZ")
+ spec = LaunchSpec(
+ program=str(app / WINDOWS_BRANDED_LAUNCHER_FILE_NAME),
+ args=("-m", "dodaios.ui.web.launcher"),
+ working_dir=str(app),
+ )
+ other = _TaskInfo(
+ execute=str(app / "other.exe"),
+ arguments="-m dodaios.ui.web.launcher",
+ working_dir=str(app),
+ )
+ mgr, _calls, _tasks, _probed = _scheduler(legacy_task_info=other)
+
+ assert mgr.status(spec).matches_spec is False
+
+
+def test_an_interactive_enable_moves_the_task_to_the_current_name_in_one_step() -> None:
+ mgr, calls, tasks, _probed = _scheduler(legacy_task_info=_MATCHING_INFO)
+
+ st = mgr.install(_SPEC, interactive=True)
+
+ # One elevation registers the current name and removes the earlier one.
+ assert calls.count("elevate_register") == 1
+ assert f"unregister:{_LEGACY_TASK_NAME}" in calls
+ assert "write_shortcut" not in calls
+ assert set(tasks) == {TASK_NAME}
+ assert st.matches_spec is True
+ assert st.entry_path == f"Task Scheduler\\{TASK_NAME}"
+
+
+def test_a_declined_rename_keeps_the_earlier_task_and_writes_no_second_entry() -> None:
+ mgr, calls, tasks, _probed = _scheduler(
+ legacy_task_info=_MATCHING_INFO, elevate_ok=False
+ )
+
+ st = mgr.install(_SPEC, interactive=True)
+
+ assert "elevate_register" in calls
+ assert "write_shortcut" not in calls
+ assert set(tasks) == {_LEGACY_TASK_NAME}
+ assert st.matches_spec is True
+
+
+def test_the_register_script_removes_the_earlier_name_only_after_registering() -> None:
+ script = build_register_task_script(
+ TASK_NAME, _SPEC, user_id="u", replaced_task_names=(_LEGACY_TASK_NAME,)
+ )
+
+ register = script.index(f"Register-ScheduledTask -TaskName '{TASK_NAME}'")
+ unregister = script.index(f"Unregister-ScheduledTask -TaskName '{_LEGACY_TASK_NAME}'")
+ assert register < unregister
+ # Both inside the one try block: a failed registration skips the removal.
+ assert unregister < script.index("} catch { exit 1 }")
+
+
+def test_an_interactive_uninstall_removes_every_name_in_one_elevation() -> None:
+ mgr, calls, tasks, _probed = _scheduler(
+ task_info=_MATCHING_INFO, legacy_task_info=_MATCHING_INFO
+ )
+
+ st = mgr.uninstall(interactive=True)
+
+ assert calls.count("elevate_unregister") == 1
+ assert {f"unregister:{TASK_NAME}", f"unregister:{_LEGACY_TASK_NAME}"} <= set(calls)
+ assert tasks == {}
+ assert st.installed is False
+
+
+def test_a_silent_uninstall_reports_a_surviving_task_under_the_earlier_name() -> None:
+ mgr, calls, _tasks, _probed = _scheduler(legacy_task_info=_MATCHING_INFO)
+
+ st = mgr.uninstall(interactive=False)
+
+ assert "elevate_unregister" not in calls
+ assert st.installed is True
+ assert st.entry_path == f"Task Scheduler\\{_LEGACY_TASK_NAME}"
+
+
+def test_a_startup_shortcut_under_the_earlier_name_counts_and_is_retired(
+ tmp_path, monkeypatch
+) -> None:
+ monkeypatch.setenv("APPDATA", str(tmp_path))
+ from dodaios.autostart import windows as win_mod
+
+ startup = win_mod._startup_dir()
+ startup.mkdir(parents=True)
+ old = startup / LEGACY_WINDOWS_SHORTCUT_FILE_NAMES[0]
+ old.write_bytes(b"lnk")
+ mgr = WindowsAutostart(task_probe=lambda _name: None)
+
+ # It starts the app at login just the same: present, and beside a task a
+ # second start, so it is retired like every earlier startup entry.
+ assert mgr._default_shortcut_present() is True
+ mgr._default_remove_shortcut()
+ assert not old.exists()
+ assert mgr._default_shortcut_present() is False
diff --git a/tests/unit/ci/test_build_distributions.py b/tests/unit/ci/test_build_distributions.py
new file mode 100644
index 0000000000..20de934a94
--- /dev/null
+++ b/tests/unit/ci/test_build_distributions.py
@@ -0,0 +1,149 @@
+"""The release builds the same code as ``dodaios`` and as ``personal-jarvis``."""
+
+from __future__ import annotations
+
+import tomllib
+from pathlib import Path
+
+import pytest
+import yaml
+
+from dodaios.core import branding
+from scripts.ci import build_distributions as bd
+
+ROOT = Path(__file__).resolve().parents[3]
+PYPROJECT = (ROOT / "pyproject.toml").read_text(encoding="utf-8")
+
+
+def test_the_names_are_the_distribution_names_branding_declares() -> None:
+ assert bd.CURRENT == branding.DISTRIBUTION_NAME
+ assert (bd.LEGACY,) == branding.LEGACY_DISTRIBUTION_NAMES
+
+
+def test_the_real_pyproject_renames_to_the_earlier_distribution() -> None:
+ project = tomllib.loads(bd.renamed_pyproject(PYPROJECT))
+ assert project["project"]["name"] == "personal-jarvis"
+ extras = project["project"]["optional-dependencies"]
+ # The earlier name's [full] must never pull in the current distribution:
+ # two distributions owning the same files is what the transition avoids.
+ assert extras["full"] == [
+ "personal-jarvis[desktop,desktop-macos,telephony,channels,local-voice]"
+ ]
+ assert extras["dev"][0] == "personal-jarvis[desktop,local-voice]"
+ assert all(
+ not item.startswith("dodaios[") for group in extras.values() for item in group
+ )
+ data_files = project["tool"]["setuptools"]["data-files"]
+ assert set(data_files) == {"share/personal-jarvis/docs", "share/personal-jarvis/docs/legal"}
+
+
+def test_only_the_names_change() -> None:
+ original = tomllib.loads(PYPROJECT)
+ renamed = tomllib.loads(bd.renamed_pyproject(PYPROJECT))
+ for key in ("version", "dependencies", "scripts", "entry-points", "requires-python"):
+ assert renamed["project"][key] == original["project"][key], key
+ for key in ("packages", "package-data", "exclude-package-data"):
+ assert renamed["tool"]["setuptools"][key] == original["tool"]["setuptools"][key], key
+ assert renamed["build-system"] == original["build-system"]
+
+
+def test_a_pyproject_under_another_name_is_refused() -> None:
+ with pytest.raises(ValueError, match="expected"):
+ bd.renamed_pyproject('[project]\nname = "something-else"\nversion = "1.0.0"\n')
+
+
+def _project(tmp_path: Path) -> Path:
+ tmp_path.mkdir(parents=True, exist_ok=True)
+ (tmp_path / "pyproject.toml").write_text(
+ "[project]\n"
+ 'name = "dodaios"\n'
+ 'version = "1.2.3"\n'
+ "[project.optional-dependencies]\n"
+ 'full = ["dodaios[desktop]"]\n'
+ "[tool.setuptools.data-files]\n"
+ '"share/dodaios/docs" = ["docs/*.md"]\n',
+ encoding="utf-8",
+ )
+ return tmp_path
+
+
+def _fake_build(seen: list[tuple[str, str]]):
+ def runner(command, cwd: Path) -> None:
+ outdir = Path(command[command.index("--outdir") + 1])
+ name = tomllib.loads((cwd / "pyproject.toml").read_text(encoding="utf-8"))["project"][
+ "name"
+ ]
+ seen.append((name, outdir.name))
+ outdir.mkdir(parents=True)
+ for artifact in bd.expected_artifacts(name, "1.2.3"):
+ (outdir / artifact).write_bytes(b"artifact")
+ # What setuptools leaves behind in the tree.
+ (cwd / f"{bd._normalized(name)}.egg-info").mkdir()
+ (cwd / "build" / "lib").mkdir(parents=True, exist_ok=True)
+
+ return runner
+
+
+def test_build_all_builds_both_names_and_restores_the_pyproject(tmp_path: Path) -> None:
+ root = _project(tmp_path / "tree")
+ original = (root / "pyproject.toml").read_bytes()
+ (root / "build" / "Jarvis").mkdir(parents=True) # a PyInstaller freeze
+ seen: list[tuple[str, str]] = []
+
+ outputs = bd.build_all(tmp_path / "dist", root=root, runner=_fake_build(seen))
+
+ assert seen == [("dodaios", "dodaios"), ("personal-jarvis", "personal-jarvis")]
+ assert sorted(p.name for p in outputs["personal-jarvis"].iterdir()) == [
+ "personal_jarvis-1.2.3-py3-none-any.whl",
+ "personal_jarvis-1.2.3.tar.gz",
+ ]
+ assert (root / "pyproject.toml").read_bytes() == original
+ assert not list(root.glob("*.egg-info"))
+ assert not (root / "build" / "lib").exists()
+ assert (root / "build" / "Jarvis").is_dir()
+
+
+def test_a_failed_second_build_still_restores_the_pyproject(tmp_path: Path) -> None:
+ root = _project(tmp_path / "tree")
+ original = (root / "pyproject.toml").read_bytes()
+ seen: list[tuple[str, str]] = []
+ build = _fake_build(seen)
+
+ def runner(command, cwd: Path) -> None:
+ if seen:
+ raise OSError("second build failed")
+ build(command, cwd)
+
+ with pytest.raises(OSError, match="second build"):
+ bd.build_all(tmp_path / "dist", root=root, runner=runner)
+ assert (root / "pyproject.toml").read_bytes() == original
+
+
+def test_a_missing_artifact_fails_the_build(tmp_path: Path) -> None:
+ root = _project(tmp_path / "tree")
+
+ def runner(command, cwd: Path) -> None:
+ Path(command[command.index("--outdir") + 1]).mkdir(parents=True)
+
+ with pytest.raises(ValueError, match="expected"):
+ bd.build_all(tmp_path / "dist", root=root, runner=runner)
+
+
+def _release() -> dict:
+ return yaml.safe_load((ROOT / ".github/workflows/release.yml").read_text(encoding="utf-8"))
+
+
+def test_the_release_builds_both_names_and_publishes_each() -> None:
+ jobs = _release()["jobs"]
+ build_runs = "\n".join(step.get("run", "") for step in jobs["build"]["steps"])
+ assert "scripts/ci/build_distributions.py --outdir dist" in build_runs
+ assert "python -m build " not in build_runs
+ publishes = [
+ step
+ for step in jobs["publish"]["steps"]
+ if "gh-action-pypi-publish@" in step.get("uses", "")
+ ]
+ assert [step["with"]["packages-dir"] for step in publishes] == [
+ "dist/personal-jarvis/",
+ "dist/dodaios/",
+ ]
diff --git a/tests/unit/ci/test_installer_aliases.py b/tests/unit/ci/test_installer_aliases.py
new file mode 100644
index 0000000000..3d972d5d28
--- /dev/null
+++ b/tests/unit/ci/test_installer_aliases.py
@@ -0,0 +1,95 @@
+"""Every native installer is published under both of its names, with the same bytes."""
+
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+import yaml
+
+from scripts.ci import installer_aliases, release_assets
+
+ROOT = Path(__file__).resolve().parents[3]
+PAIRS = release_assets.INSTALLER_NAME_PAIRS
+
+
+def _stage(directory: Path, names: list[str]) -> None:
+ for name in names:
+ (directory / name).write_bytes(f"signed bytes of {name.split('-', 1)[1]}".encode())
+
+
+def test_the_build_names_are_copied_to_the_earlier_names(tmp_path: Path) -> None:
+ # What the OS jobs upload: the setup under its signed (earlier) name, the
+ # rest under the current name.
+ windows, *others = PAIRS
+ _stage(tmp_path, [windows[1], *(current for current, _earlier in others)])
+
+ written = installer_aliases.add_aliases(tmp_path)
+
+ assert sorted(written) == sorted([windows[0], *(earlier for _current, earlier in others)])
+ for current, earlier in PAIRS:
+ assert (tmp_path / current).read_bytes() == (tmp_path / earlier).read_bytes()
+
+
+def test_a_pair_already_complete_is_left_alone(tmp_path: Path) -> None:
+ _stage(tmp_path, [name for pair in PAIRS for name in pair])
+ assert installer_aliases.add_aliases(tmp_path) == []
+
+
+def test_two_different_files_under_one_installers_names_fail(tmp_path: Path) -> None:
+ _stage(tmp_path, [name for pair in PAIRS for name in pair])
+ current, _earlier = PAIRS[0]
+ (tmp_path / current).write_bytes(b"signed separately")
+ with pytest.raises(ValueError, match="differ in content"):
+ installer_aliases.add_aliases(tmp_path)
+
+
+def test_a_missing_installer_fails_instead_of_shipping_half_a_release(tmp_path: Path) -> None:
+ _stage(tmp_path, [current for current, _earlier in PAIRS[1:]])
+ assert installer_aliases.main([str(tmp_path)]) == 1
+
+
+def test_the_pairs_cover_exactly_the_published_installers() -> None:
+ assert {name for pair in PAIRS for name in pair} == release_assets.INSTALLERS
+ assert all(current.startswith("Dodaios-") for current, _earlier in PAIRS)
+ assert all(earlier.startswith("PersonalJarvis-") for _current, earlier in PAIRS)
+
+
+def test_the_release_job_aliases_after_download_and_before_the_manifest() -> None:
+ workflow = yaml.safe_load(
+ (ROOT / ".github/workflows/desktop-installers.yml").read_text(encoding="utf-8")
+ )
+ steps = workflow["jobs"]["release"]["steps"]
+ runs = [step.get("run", "") for step in steps]
+ download = next(i for i, s in enumerate(steps) if "download-artifact@" in s.get("uses", ""))
+ alias = next(i for i, run in enumerate(runs) if "installer_aliases.py installers" in run)
+ manifest = next(i for i, run in enumerate(runs) if "installers-SHA256SUMS.txt" in run)
+ assert download < alias < manifest
+ for name in release_assets.INSTALLERS:
+ assert name in runs[manifest], name
+
+
+def test_the_windows_setup_is_signed_under_the_pinned_name() -> None:
+ """SignPath pins the setup's file name; the current name is copied later."""
+ workflow = yaml.safe_load(
+ (ROOT / ".github/workflows/desktop-installers.yml").read_text(encoding="utf-8")
+ )
+ windows = workflow["jobs"]["windows"]["steps"]
+ staged = next(s for s in windows if s.get("id") == "signpath-unsigned")
+ upload = next(s for s in windows if s.get("name") == "Upload the installer")
+ assert staged["with"]["path"].endswith("/PersonalJarvis-Setup-x64.exe")
+ assert upload["with"]["path"].endswith("/PersonalJarvis-Setup-x64.exe")
+ iss = (ROOT / "packaging/windows/PersonalJarvis.iss").read_text(encoding="utf-8")
+ assert '#define SignedSetupBaseName "PersonalJarvis-Setup-x64"' in iss
+ assert "OutputBaseFilename={#SignedSetupBaseName}" in iss
+
+
+ ("script", "expected"),
+ [
+ ("packaging/macos/build.sh", 'DMG_PATH="${OUT_DIR}/Dodaios-macOS-${ARCH_TAG}.dmg"'),
+ ("packaging/linux/build.sh", 'APPIMAGE_PATH="${OUT_DIR}/Dodaios-Linux-x86_64.AppImage"'),
+ ],
+)
+def test_the_macos_and_linux_builds_produce_the_current_names(script, expected) -> None:
+ assert expected in (ROOT / script).read_text(encoding="utf-8")
diff --git a/tests/unit/ci/test_pipeline_audit.py b/tests/unit/ci/test_pipeline_audit.py
index 1fb3461a37..c5bfc5d660 100644
--- a/tests/unit/ci/test_pipeline_audit.py
+++ b/tests/unit/ci/test_pipeline_audit.py
@@ -1036,7 +1036,7 @@ class FakeRelease:
elif args[:2] == ["git", "show"]:
output = "## [1.2.3]\n\nRelease notes.\n"
elif args[:3] == ["gh", "release", "upload"]:
- for file in map(Path, args[6:8]):
+ for file in map(Path, args[6 : args.index("--clobber")]):
digest = hashlib.sha256(file.read_bytes()).hexdigest()
self.assets.append({"name": file.name, "digest": f"sha256:{digest}"})
if self.corrupt_source:
@@ -1070,6 +1070,14 @@ def test_finalization_uploads_and_verifies_source_before_publication(monkeypatch
assert release_assets.finalize(REPO, TAG, SHA, 0) == 0
assert fake.commands[-1][:3] == ["gh", "release", "edit"]
assert sum(command[:3] == ["gh", "release", "upload"] for command in fake.commands) == 1
+ # The source archive under its current name and the one older installers know.
+ prefixes = [c[3] for c in fake.commands if c[:2] == ["git", "archive"]]
+ assert prefixes == ["--prefix=dodaios/", "--prefix=personal-jarvis/"]
+ assert {asset["name"] for asset in fake.assets} >= {
+ "dodaios-src.tar.gz",
+ "personal-jarvis-src.tar.gz",
+ "source-SHA256SUMS.txt",
+ }
@pytest.mark.parametrize("defect", ["corrupt_source", "wrong_payload"])
diff --git a/tests/unit/ci/test_pipeline_scripts.py b/tests/unit/ci/test_pipeline_scripts.py
index 2e1c773037..c14a15a2ed 100644
--- a/tests/unit/ci/test_pipeline_scripts.py
+++ b/tests/unit/ci/test_pipeline_scripts.py
@@ -46,7 +46,7 @@ def test_frontend_source_change_keeps_python_on_because_tests_read_it():
def test_unrelated_subproject_skips_python():
- result = classify_changes.classify(["wiki-video/src/scene.tsx", "homebrew-tap/Formula/x.rb"])
+ result = classify_changes.classify(["wiki-video/src/scene.tsx", "board-backend/x.ts"])
assert result["python"] is False
assert not any(result[lane] for lane in classify_changes.LANES)
diff --git a/tests/unit/ci/test_release_smoke.py b/tests/unit/ci/test_release_smoke.py
index aa7f7fe1df..a7d9291fe3 100644
--- a/tests/unit/ci/test_release_smoke.py
+++ b/tests/unit/ci/test_release_smoke.py
@@ -28,8 +28,10 @@ class FakePublishedRelease:
def __init__(self, *, attested=0, attestation_ok=True, draft=False, outages=0):
self.payloads = {
+ "Dodaios-Linux-x86_64.AppImage": b"appimage",
"PersonalJarvis-Linux-x86_64.AppImage": b"appimage",
"personal-jarvis_1.2.3_amd64.deb": b"deb",
+ "Dodaios-Setup-x64.exe": b"exe",
"PersonalJarvis-Setup-x64.exe": b"exe",
}
self.manifest = "".join(
@@ -86,11 +88,26 @@ def test_linux_smoke_checks_appimage_and_deb_against_provenance(monkeypatch, tmp
assert errors == []
verified = [c[3] for c in fake.commands if c[:3] == ["gh", "attestation", "verify"]]
assert sorted(Path(p).name for p in verified) == [
+ "Dodaios-Linux-x86_64.AppImage",
"PersonalJarvis-Linux-x86_64.AppImage",
"personal-jarvis_1.2.3_amd64.deb",
]
+def test_a_renamed_debian_package_is_checked_too(monkeypatch, tmp_path):
+ fake = FakePublishedRelease(attested=1)
+ fake.payloads["dodaios_1.2.3_amd64.deb"] = fake.payloads.pop("personal-jarvis_1.2.3_amd64.deb")
+ fake.manifest = "".join(
+ f"{hashlib.sha256(data).hexdigest()} {name}\n"
+ for name, data in sorted(fake.payloads.items())
+ )
+ fake.install(monkeypatch)
+ errors = release_assets.platform_errors(REPO, TAG, "linux", tmp_path, require_attestation=True)
+ assert errors == []
+ verified = {Path(c[3]).name for c in fake.commands if c[:3] == ["gh", "attestation", "verify"]}
+ assert "dodaios_1.2.3_amd64.deb" in verified
+
+
@pytest.mark.parametrize(
"defect,require,expected",
[
@@ -144,10 +161,14 @@ def test_a_lasting_attestation_outage_fails_only_required_provenance(
REPO, TAG, "windows", tmp_path, require_attestation=require
)
lookups = [c for c in fake.commands if c[:2] == ["gh", "api"]]
- assert len(lookups) == 3
+ # Three tries for each of the two names the setup is published under.
+ assert len(lookups) == 6
assert bool(errors) is failing
if failing:
- assert errors == ["build provenance attestation unavailable: PersonalJarvis-Setup-x64.exe"]
+ assert errors == [
+ "build provenance attestation unavailable: Dodaios-Setup-x64.exe",
+ "build provenance attestation unavailable: PersonalJarvis-Setup-x64.exe",
+ ]
def test_smoke_refuses_a_draft_without_touching_it(monkeypatch):
@@ -161,7 +182,8 @@ def test_source_archive_digest_is_part_of_the_published_check(monkeypatch):
digest = "b" * 64
assets = [
{"name": name, "size": 1, "state": "uploaded", "digest": f"sha256:{digest}"}
- for name in release_assets.REQUIRED_ASSETS | {"personal-jarvis-src.tar.gz"}
+ for name in release_assets.REQUIRED_ASSETS
+ | {"dodaios-src.tar.gz", "personal-jarvis-src.tar.gz"}
]
manifests = {
"installers-SHA256SUMS.txt": "".join(
@@ -170,7 +192,9 @@ def test_source_archive_digest_is_part_of_the_published_check(monkeypatch):
"checksums.txt": "".join(
f"{digest} {n}\n" for n in sorted(release_assets.SIGNED - {"payload-commit.txt"})
),
- "source-SHA256SUMS.txt": f"{'c' * 64} personal-jarvis-src.tar.gz\n",
+ "source-SHA256SUMS.txt": (
+ f"{'c' * 64} dodaios-src.tar.gz\n{'c' * 64} personal-jarvis-src.tar.gz\n"
+ ),
}
def command(args, **kwargs):
@@ -185,12 +209,27 @@ def test_source_archive_digest_is_part_of_the_published_check(monkeypatch):
release_assets, "release_info", lambda *a: {"databaseId": 1, "tagName": TAG}
)
assert release_assets.published_errors(REPO, TAG) == [
- "release asset checksum mismatch: personal-jarvis-src.tar.gz"
+ "release asset checksum mismatch: dodaios-src.tar.gz",
+ "release asset checksum mismatch: personal-jarvis-src.tar.gz",
]
manifests["source-SHA256SUMS.txt"] = f"{digest} personal-jarvis-src.tar.gz\n"
+ assert release_assets.published_errors(REPO, TAG) == [
+ "incomplete manifest: source-SHA256SUMS.txt lacks dodaios-src.tar.gz"
+ ]
+ manifests["source-SHA256SUMS.txt"] = (
+ f"{digest} dodaios-src.tar.gz\n{digest} personal-jarvis-src.tar.gz\n"
+ )
assert release_assets.published_errors(REPO, TAG) == []
+def test_both_names_of_an_installer_must_carry_the_same_bytes():
+ current, earlier = release_assets.INSTALLER_NAME_PAIRS[0]
+ assert release_assets.alias_errors({current: "a" * 64, earlier: "a" * 64}) == []
+ assert release_assets.alias_errors({current: "a" * 64, earlier: "b" * 64}) == [
+ f"installer names differ in content: {current} and {earlier}"
+ ]
+
+
def test_native_installers_are_attested_on_tags_before_upload():
job = workflows()["desktop-installers.yml"]["jobs"]["release"]
assert job["permissions"]["id-token"] == "write"
diff --git a/tests/unit/core/test_branding.py b/tests/unit/core/test_branding.py
index dbc77f56d8..6d4a2c161d 100644
--- a/tests/unit/core/test_branding.py
+++ b/tests/unit/core/test_branding.py
@@ -19,9 +19,13 @@ _CURRENT_IDENTITY = {
"PERSISTENT_SLUG": "personal-jarvis",
"PRODUCT_COMPACT_NAME": "PersonalJarvis",
"PRODUCT_SLUG": "personal-jarvis",
- "LAUNCHER_ENTRY_NAME": "Personal Jarvis",
- "CONFIG_FILE_NAME": "jarvis.toml",
- "DISTRIBUTION_NAME": "personal-jarvis",
+ "LAUNCHER_ENTRY_NAME": "Dodaios",
+ "LEGACY_LAUNCHER_ENTRY_NAMES": ("Personal Jarvis",),
+ "CONFIG_FILE_NAME": "dodaios.toml",
+ "LEGACY_CONFIG_FILE_NAMES": ("jarvis.toml",),
+ "DISTRIBUTION_NAME": "dodaios",
+ "LEGACY_DISTRIBUTION_NAMES": ("personal-jarvis",),
+ "DISTRIBUTION_NAMES": ("dodaios", "personal-jarvis"),
"CLI_COMMAND_NAME": "dodaios",
"CONTROL_CLI_COMMAND_NAME": "dodaiosctl",
"LEGACY_CLI_COMMAND_NAMES": ("jarvis", "personal-jarvis"),
@@ -29,35 +33,59 @@ _CURRENT_IDENTITY = {
"CLI_COMMAND_NAMES": ("dodaios", "dodaiosctl", "jarvis", "personal-jarvis", "jarvisctl"),
"SHELL_PROFILE_MARKER": "# Personal Jarvis: command-line tools (jarvis, personal-jarvis)",
"FISH_CONF_FILE_NAME": "personal-jarvis.fish",
- "KEYRING_SERVICE_NAME": "personal-jarvis",
+ "KEYRING_SERVICE_NAME": "dodaios",
+ "LEGACY_KEYRING_SERVICE_NAMES": ("personal-jarvis",),
"CONTROL_KEY_PREFIX": "jctl_",
"SESSION_COOKIE_NAME": "jarvis_session",
- "MANAGED_INSTALL_MARKER": ".jarvis-managed-install",
- "DEFAULT_INSTALL_DIR_NAME": ".personal-jarvis",
- "WINDOWS_USER_DATA_DIR_NAME": "Jarvis",
- "FALLBACK_USER_DATA_DIR_NAME": ".jarvis",
- "DESKTOP_OUTPUT_MIRROR_DIR_NAME": "Jarvis-Output",
- "WINDOWS_MUTEX_NAME": r"Global\PersonalJarvis_v1",
+ "MANAGED_INSTALL_MARKER": ".dodaios-managed-install",
+ "LEGACY_MANAGED_INSTALL_MARKERS": (".jarvis-managed-install",),
+ "MANAGED_INSTALL_MARKERS": (".dodaios-managed-install", ".jarvis-managed-install"),
+ "DEFAULT_INSTALL_DIR_NAME": ".dodaios",
+ "LEGACY_DEFAULT_INSTALL_DIR_NAMES": (".personal-jarvis",),
+ "WINDOWS_USER_DATA_DIR_NAME": "Dodaios",
+ "LEGACY_WINDOWS_USER_DATA_DIR_NAMES": ("Jarvis",),
+ "FALLBACK_USER_DATA_DIR_NAME": ".dodaios-data",
+ "LEGACY_FALLBACK_USER_DATA_DIR_NAMES": (".jarvis",),
+ "DESKTOP_OUTPUT_MIRROR_DIR_NAME": "Dodaios-Output",
+ "LEGACY_DESKTOP_OUTPUT_MIRROR_DIR_NAMES": ("Jarvis-Output",),
+ "DELIVERABLES_DIR_NAME": "Dodaios-Outputs",
+ "LEGACY_DELIVERABLES_DIR_NAMES": ("Jarvis-Outputs",),
+ "OBSIDIAN_VAULT_FOLDER_NAME": "Dodaios",
+ "LEGACY_OBSIDIAN_VAULT_FOLDER_NAMES": ("Jarvis",),
+ "WINDOWS_MUTEX_NAME": r"Global\Dodaios_v1",
+ "LEGACY_WINDOWS_MUTEX_NAMES": (r"Global\PersonalJarvis_v1",),
"WINDOWS_APP_USER_MODEL_ID": "PersonalJarvis.PersonalJarvis",
"WINDOWS_UNINSTALL_REGISTRY_SUBKEY": (
r"Software\Microsoft\Windows\CurrentVersion\Uninstall\PersonalJarvis"
),
- "WINDOWS_AUTOSTART_TASK_NAME": "Personal Jarvis Autostart",
- "WINDOWS_SHORTCUT_FILE_NAME": "Personal Jarvis.lnk",
- "WINDOWS_AUTOSTART_DESCRIPTION": "Personal Jarvis (Autostart)",
- "WINDOWS_BRANDED_LAUNCHER_FILE_NAME": "PersonalJarvis.exe",
- "WINDOWS_BRANDED_LAUNCHER_DIR_NAME": "PersonalJarvis",
+ "WINDOWS_AUTOSTART_TASK_NAME": "Dodaios Autostart",
+ "LEGACY_WINDOWS_AUTOSTART_TASK_NAMES": ("Personal Jarvis Autostart",),
+ "WINDOWS_SHORTCUT_FILE_NAME": "Dodaios.lnk",
+ "LEGACY_WINDOWS_SHORTCUT_FILE_NAMES": ("Personal Jarvis.lnk",),
+ "WINDOWS_AUTOSTART_DESCRIPTION": "Dodaios (Autostart)",
+ "LEGACY_WINDOWS_AUTOSTART_DESCRIPTIONS": ("Personal Jarvis (Autostart)",),
+ "WINDOWS_BRANDED_LAUNCHER_FILE_NAME": "DodaiosApp.exe",
+ "LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES": ("PersonalJarvis.exe",),
+ "WINDOWS_BRANDED_LAUNCHER_DIR_NAME": "DodaiosApp",
+ "LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES": ("PersonalJarvis",),
"WINDOWS_BRANDED_LAUNCH_ENV_VAR": "JARVIS_BRANDED_LAUNCH",
- "MACOS_APP_NAME": "Personal Jarvis",
- "MACOS_APP_DIR_NAME": "Personal Jarvis.app",
- "MACOS_EXECUTABLE_NAME": "PersonalJarvis",
+ "MACOS_APP_NAME": "Dodaios",
+ "LEGACY_MACOS_APP_NAMES": ("Personal Jarvis",),
+ "MACOS_APP_DIR_NAME": "Dodaios.app",
+ "LEGACY_MACOS_APP_DIR_NAMES": ("Personal Jarvis.app",),
+ "MACOS_APP_DIR_NAMES": ("Dodaios.app", "Personal Jarvis.app"),
+ "MACOS_EXECUTABLE_NAME": "DodaiosApp",
+ "LEGACY_MACOS_EXECUTABLE_NAMES": ("PersonalJarvis",),
"MACOS_BUNDLE_ID": "com.personal-jarvis.desktop",
"MACOS_DMG_BUNDLE_ID": "ai.personaljarvis.desktop",
"MACOS_AUTOSTART_LABEL": "com.personal-jarvis.autostart",
"MACOS_SIGNING_IDENTITY_LABEL": "Personal Jarvis Local Signing",
- "LINUX_APP_NAME": "Personal Jarvis",
- "LINUX_DESKTOP_ENTRY_FILE_NAME": "personal-jarvis.desktop",
- "LINUX_WM_CLASS": "personal-jarvis",
+ "LINUX_APP_NAME": "Dodaios",
+ "LEGACY_LINUX_APP_NAMES": ("Personal Jarvis",),
+ "LINUX_DESKTOP_ENTRY_FILE_NAME": "dodaios.desktop",
+ "LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES": ("personal-jarvis.desktop",),
+ "LINUX_WM_CLASS": "dodaios",
+ "LEGACY_LINUX_WM_CLASSES": ("personal-jarvis",),
"DEFAULT_OFFICIAL_REPO_SLUG": "Dodaios/Dodaios",
"OFFICIAL_REPO_SLUG_ENV_VAR": "JARVIS_OFFICIAL_REPO_SLUG",
"OFFICIAL_REPO_SLUG": "Dodaios/Dodaios",
@@ -70,6 +98,70 @@ _CURRENT_IDENTITY = {
}
+# Names that moved to the product's spelling together with their migration.
+# Each keeps its earlier values in the matching ``LEGACY_*`` tuple.
+_MIGRATED_TO_THE_PRODUCT_NAME = frozenset(
+ {
+ "CONFIG_FILE_NAME",
+ "WINDOWS_USER_DATA_DIR_NAME",
+ "FALLBACK_USER_DATA_DIR_NAME",
+ "DESKTOP_OUTPUT_MIRROR_DIR_NAME",
+ "DELIVERABLES_DIR_NAME",
+ "OBSIDIAN_VAULT_FOLDER_NAME",
+ "MANAGED_INSTALL_MARKER",
+ "DEFAULT_INSTALL_DIR_NAME",
+ # The Windows identity: launcher, shortcut, logon task, mutex.
+ "LAUNCHER_ENTRY_NAME",
+ "WINDOWS_MUTEX_NAME",
+ "WINDOWS_AUTOSTART_TASK_NAME",
+ "WINDOWS_AUTOSTART_DESCRIPTION",
+ "WINDOWS_SHORTCUT_FILE_NAME",
+ "WINDOWS_BRANDED_LAUNCHER_FILE_NAME",
+ "WINDOWS_BRANDED_LAUNCHER_DIR_NAME",
+ "MACOS_EXECUTABLE_NAME",
+ # The Linux identity: menu name, desktop entry and window class, which
+ # only work together (the desktop binds a window to the entry whose
+ # StartupWMClass is the window's class).
+ "LINUX_APP_NAME",
+ "LINUX_DESKTOP_ENTRY_FILE_NAME",
+ "LINUX_WM_CLASS",
+ # The Python distribution (pip install name, share/<name>).
+ "DISTRIBUTION_NAME",
+ # The macOS bundle's name; its ids, login label and signing label stay.
+ "MACOS_APP_NAME",
+ "MACOS_APP_DIR_NAME",
+ }
+)
+# Every spelling of a migrated name, the current one first.
+_ALL_SPELLINGS_OF_A_MIGRATED_NAME = frozenset(
+ {"MANAGED_INSTALL_MARKERS", "DISTRIBUTION_NAMES", "MACOS_APP_DIR_NAMES"}
+)
+
+
+def _legacy_values(name: str) -> tuple[str, ...]:
+ """The ``LEGACY_*`` tuple of ``name``: its plural, ``-ES`` after an ``S``."""
+ plural = f"LEGACY_{name}ES" if name.endswith("S") else f"LEGACY_{name}S"
+ return getattr(branding, plural)
+
+
+def test_every_migrated_name_keeps_its_earlier_values() -> None:
+ for name in _MIGRATED_TO_THE_PRODUCT_NAME:
+ legacy = _legacy_values(name)
+ assert legacy, name
+ assert getattr(branding, name) not in legacy, name
+
+
+def test_the_linux_names_move_as_one_generation() -> None:
+ # The entry, the class it binds a window by and the menu name are all
+ # current, and each earlier spelling is the one earlier releases shipped.
+ assert branding.LINUX_DESKTOP_ENTRY_FILE_NAME == f"{branding.LINUX_WM_CLASS}.desktop"
+ assert branding.LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES == tuple(
+ f"{wm_class}.desktop" for wm_class in branding.LEGACY_LINUX_WM_CLASSES
+ )
+ assert branding.LEGACY_LINUX_WM_CLASSES == (branding.PERSISTENT_SLUG,)
+ assert branding.LEGACY_LINUX_APP_NAMES == (branding.PERSISTENT_PRODUCT_NAME,)
+
+
def test_default_exported_identity_values_are_frozen() -> None:
previous = os.environ.pop(branding.OFFICIAL_REPO_SLUG_ENV_VAR, None)
try:
@@ -82,6 +174,32 @@ def test_default_exported_identity_values_are_frozen() -> None:
importlib.reload(branding)
+def test_the_windows_identity_keeps_what_pins_and_installs_resolve_by() -> None:
+ # The taskbar groups windows and resolves pins by the AUMID, a source
+ # install's Installed Apps entry lives under the subkey, and a process of
+ # an earlier release reads the branded-launch variable: none of them moved.
+ assert "Dodaios" not in branding.WINDOWS_APP_USER_MODEL_ID
+ assert "Dodaios" not in branding.WINDOWS_UNINSTALL_REGISTRY_SUBKEY
+ assert branding.WINDOWS_BRANDED_LAUNCH_ENV_VAR == "JARVIS_BRANDED_LAUNCH"
+ # The launcher folder sits beside the data directory and must not be it.
+ assert (
+ branding.WINDOWS_BRANDED_LAUNCHER_DIR_NAME.casefold()
+ != branding.WINDOWS_USER_DATA_DIR_NAME.casefold()
+ )
+
+
+def test_the_macos_identity_keeps_what_privacy_grants_are_pinned_to() -> None:
+ # A bundle id, the login item's label or the signing certificate's name
+ # that moved would start every macOS privacy grant over: only the bundle's
+ # name moved, and a bundle under its earlier name is renamed in place.
+ assert branding.MACOS_BUNDLE_ID == "com.personal-jarvis.desktop"
+ assert branding.MACOS_DMG_BUNDLE_ID == "ai.personaljarvis.desktop"
+ assert branding.MACOS_AUTOSTART_LABEL == "com.personal-jarvis.autostart"
+ assert branding.MACOS_SIGNING_IDENTITY_LABEL == "Personal Jarvis Local Signing"
+ assert branding.MACOS_APP_DIR_NAMES[0] == branding.MACOS_APP_DIR_NAME
+ assert set(branding.MACOS_APP_DIR_NAMES[1:]) == set(branding.LEGACY_MACOS_APP_DIR_NAMES)
+
+
def test_display_name_is_separate_from_persistent_identity() -> None:
assert branding.PRODUCT_NAME == "Dodaios"
# No persistent identifier is built from the display name: renaming the
@@ -90,10 +208,16 @@ def test_display_name_is_separate_from_persistent_identity() -> None:
for name in _CURRENT_IDENTITY:
if "REPO" in name or "RELEASES" in name:
continue # the repository is itself called Dodaios/Dodaios
- if "CLI_COMMAND" in name:
- # The commands are spelled like the product by choice, as literals
- # of their own: the next test shows they do not follow the display
- # name, and the earlier command names stay beside them.
+ if (
+ "CLI_COMMAND" in name
+ or name in _MIGRATED_TO_THE_PRODUCT_NAME
+ or name in _ALL_SPELLINGS_OF_A_MIGRATED_NAME
+ or name == "KEYRING_SERVICE_NAME"
+ ):
+ # Spelled like the product by choice, as literals of their own: the
+ # next test shows they do not follow the display name, and each
+ # keeps its earlier names beside it, found by the migration that
+ # carried it over (dodaios.core.identity_boot).
continue
assert display not in str(getattr(branding, name)).casefold(), name
diff --git a/tests/unit/core/test_container_persistence_contract.py b/tests/unit/core/test_container_persistence_contract.py
index 2889df20bf..3a9a41eeef 100644
--- a/tests/unit/core/test_container_persistence_contract.py
+++ b/tests/unit/core/test_container_persistence_contract.py
@@ -28,3 +28,18 @@ def test_non_root_image_keeps_config_inside_the_persisted_writable_volume() -> N
assert "libportaudio2 curl git" in dockerfile
assert non_root_user in dockerfile
assert dockerfile.index(chown_data) < dockerfile.index(non_root_user)
+
+
+def test_the_image_is_named_dodaios_and_existing_deployments_keep_their_volume() -> None:
+ """The rename moves the image name, never the data an earlier image left behind."""
+ import yaml
+
+ dockerfile = (_REPO_ROOT / "Dockerfile").read_text(encoding="utf-8")
+ compose = yaml.safe_load((_REPO_ROOT / "docker-compose.yml").read_text(encoding="utf-8"))
+
+ assert 'org.opencontainers.image.title="Dodaios"' in dockerfile
+ assert "docker build -t dodaios ." in dockerfile
+ service = compose["services"]["jarvis"]
+ assert service["image"] == "dodaios:local"
+ assert service["volumes"] == [f"jarvis-data:{_DATA_DIR.as_posix()}"]
+ assert set(compose["volumes"]) == {"jarvis-data"}
diff --git a/tests/unit/core/test_control_key.py b/tests/unit/core/test_control_key.py
index d4f0159bc8..5fb68efea0 100644
--- a/tests/unit/core/test_control_key.py
+++ b/tests/unit/core/test_control_key.py
@@ -489,3 +489,28 @@ def test_get_logs_a_warning_naming_the_remedy(isolated, monkeypatch, caplog) ->
and "fresh random value" in record.getMessage()
for record in caplog.records
)
+
+
+def test_the_macos_keychain_probe_looks_under_every_credential_service(monkeypatch) -> None:
+ probed: list[str] = []
+
+ def fake_run(argv, **_kwargs): # noqa: ANN001, ANN003
+ service = argv[argv.index("-s") + 1]
+ probed.append(service)
+ # Only the legacy service holds the item: a key saved before the rename.
+ return SimpleNamespace(returncode=0 if service in cfg.LEGACY_KEYRING_SERVICES else 44)
+
+ monkeypatch.setattr(ck.sys, "platform", "darwin")
+ monkeypatch.setattr(ck.subprocess, "run", fake_run)
+
+ assert ck._macos_keychain_item_exists() is True
+ assert probed == [cfg.KEYRING_SERVICE, *cfg.LEGACY_KEYRING_SERVICES]
+
+
+def test_the_macos_keychain_probe_finds_nothing_when_no_service_has_the_item(
+ monkeypatch,
+) -> None:
+ monkeypatch.setattr(ck.sys, "platform", "darwin")
+ monkeypatch.setattr(ck.subprocess, "run", lambda *_a, **_k: SimpleNamespace(returncode=44))
+
+ assert ck._macos_keychain_item_exists() is False
diff --git a/tests/unit/core/test_desktop_entry.py b/tests/unit/core/test_desktop_entry.py
index 512a1b6f08..6951882790 100644
--- a/tests/unit/core/test_desktop_entry.py
+++ b/tests/unit/core/test_desktop_entry.py
@@ -11,6 +11,7 @@ from __future__ import annotations
from dodaios.core.desktop_entry import (
escape_value,
exec_argument,
+ exec_program,
exec_value,
read_field,
reads_as_false,
@@ -172,3 +173,24 @@ def test_boolean_readers_are_case_and_space_tolerant() -> None:
assert reads_as_true("TRUE") is True
assert reads_as_false("true") is False
assert reads_as_true("0") is False
+
+
+# ---- Reading the program back -------------------------------------------------
+
+
+def test_exec_program_reads_back_every_program_exec_value_writes() -> None:
+ for program in (
+ "/usr/bin/python3",
+ "/opt/My Apps/python3",
+ "/home/u/100% sure/python",
+ '/home/u/a "quoted" dir/python',
+ "/home/u/back" + chr(92) + "slash/python",
+ "/home/u/$HOME`x`/python",
+ ):
+ assert exec_program(exec_value(program, ("-m", "dodaios.ui.web.launcher"))) == program
+
+
+def test_exec_program_of_a_missing_or_empty_value_is_empty() -> None:
+ assert exec_program(None) == ""
+ assert exec_program("") == ""
+ assert exec_program(" ") == ""
diff --git a/tests/unit/core/test_distribution.py b/tests/unit/core/test_distribution.py
new file mode 100644
index 0000000000..2514ca1056
--- /dev/null
+++ b/tests/unit/core/test_distribution.py
@@ -0,0 +1,77 @@
+"""One environment holding both distribution names is reported once, off the boot path."""
+
+from __future__ import annotations
+
+import logging
+import threading
+
+import pytest
+
+from dodaios.core import distribution
+
+
[email protected](autouse=True)
+def _fresh_schedule(monkeypatch):
+ monkeypatch.setattr(distribution, "_scheduled", False)
+
+
+def test_one_name_installed_is_quiet(caplog) -> None:
+ caplog.set_level(logging.WARNING)
+ for installed in ({"dodaios"}, {"personal-jarvis"}, set()):
+ assert distribution.check_duplicate_distributions(
+ is_installed=installed.__contains__
+ ) is None
+ assert caplog.records == []
+
+
+def test_both_names_installed_names_the_fix(caplog) -> None:
+ caplog.set_level(logging.WARNING)
+ message = distribution.check_duplicate_distributions(
+ is_installed={"dodaios", "personal-jarvis"}.__contains__
+ )
+ assert message is not None
+ assert "dodaios and personal-jarvis are both installed" in message
+ assert "pip uninstall -y personal-jarvis" in message
+ assert "pip install --force-reinstall --no-deps dodaios" in message
+ assert [record.getMessage() for record in caplog.records] == [message]
+
+
+def test_the_check_reads_installed_metadata(monkeypatch) -> None:
+ seen = []
+
+ def distribution_of(name):
+ seen.append(name)
+ if name == "personal-jarvis":
+ raise distribution.metadata.PackageNotFoundError(name)
+ return object()
+
+ monkeypatch.setattr(distribution.metadata, "distribution", distribution_of)
+ assert distribution.installed_distribution_names() == ("dodaios",)
+ assert seen == ["dodaios", "personal-jarvis"]
+
+
+def test_the_check_runs_once_in_the_main_instance_only(monkeypatch) -> None:
+ ran = threading.Event()
+ monkeypatch.setattr(distribution, "check_duplicate_distributions", ran.set)
+ primary = {"JARVIS_PRIMARY_INSTANCE": "1"}
+
+ assert distribution.schedule_duplicate_distribution_check(delay_s=0, environ={}) is None
+ thread = distribution.schedule_duplicate_distribution_check(delay_s=0, environ=primary)
+ assert thread is not None and thread.daemon
+ thread.join(timeout=5)
+ assert ran.is_set()
+ assert distribution.schedule_duplicate_distribution_check(delay_s=0, environ=primary) is None
+
+
+def test_a_frozen_build_never_checks(monkeypatch) -> None:
+ monkeypatch.setattr(distribution.sys, "frozen", True, raising=False)
+ environ = {"JARVIS_PRIMARY_INSTANCE": "1"}
+ assert distribution.schedule_duplicate_distribution_check(delay_s=0, environ=environ) is None
+
+
+def test_a_failing_check_never_raises(monkeypatch) -> None:
+ def boom():
+ raise RuntimeError("metadata unreadable")
+
+ monkeypatch.setattr(distribution, "check_duplicate_distributions", boom)
+ distribution._run(0)
diff --git a/tests/unit/core/test_doc_paths.py b/tests/unit/core/test_doc_paths.py
index 875bd84bf2..2a9d3d3c7c 100644
--- a/tests/unit/core/test_doc_paths.py
+++ b/tests/unit/core/test_doc_paths.py
@@ -1,5 +1,7 @@
from pathlib import Path
+import pytest
+
from dodaios.core import paths
@@ -28,12 +30,15 @@ def test_engineering_docs_are_never_exposed_as_reader_content(
assert paths.default_doc_roots() == []
[email protected]("distribution", ["dodaios", "personal-jarvis"])
def test_installed_wheel_docs_are_used_without_a_source_tree(
monkeypatch,
tmp_path: Path,
+ distribution: str,
) -> None:
+ # A wheel under the earlier distribution name installs its earlier share dir.
data_root = tmp_path / "environment"
- installed = data_root / "share" / "personal-jarvis" / "docs"
+ installed = data_root / "share" / distribution / "docs"
installed.mkdir(parents=True)
monkeypatch.setattr(paths, "repo_root", lambda: tmp_path / "site-packages")
monkeypatch.setattr(paths.sysconfig, "get_path", lambda _name, **_kwargs: str(data_root))
@@ -41,6 +46,20 @@ def test_installed_wheel_docs_are_used_without_a_source_tree(
assert paths.default_doc_roots() == [installed]
+def test_the_current_distribution_docs_win_over_the_earlier_ones(
+ monkeypatch,
+ tmp_path: Path,
+) -> None:
+ data_root = tmp_path / "environment"
+ current = data_root / "share" / "dodaios" / "docs"
+ for docs in (current, data_root / "share" / "personal-jarvis" / "docs"):
+ docs.mkdir(parents=True)
+ monkeypatch.setattr(paths, "repo_root", lambda: tmp_path / "site-packages")
+ monkeypatch.setattr(paths.sysconfig, "get_path", lambda _name, **_kwargs: str(data_root))
+
+ assert paths.default_doc_roots() == [current]
+
+
def test_user_install_scheme_docs_are_discovered(
monkeypatch,
tmp_path: Path,
diff --git a/tests/unit/core/test_identity_boot.py b/tests/unit/core/test_identity_boot.py
new file mode 100644
index 0000000000..e65edbaba8
--- /dev/null
+++ b/tests/unit/core/test_identity_boot.py
@@ -0,0 +1,511 @@
+"""``dodaios.core.identity_boot``: where the data directory and config file are.
+
+Why this file matters: the per-user data directory changed its name. An
+existing installation still has every memory, skill and log under the earlier
+name, and the config file is still ``jarvis.toml``. A wrong answer here is an
+app that starts on an empty directory while the user's data sits next to it,
+or two processes that move the same directory at once. The tests run on real
+directories under ``tmp_path``.
+"""
+
+from __future__ import annotations
+
+import ast
+import functools
+import os
+import sys
+from collections.abc import Iterator
+from pathlib import Path
+
+import pytest
+
+from dodaios.core import branding, identity_boot, paths
+from dodaios.core import config as core_config
+from dodaios.core.identity_boot import (
+ DirectoryPair,
+ may_migrate,
+ migrate_at_boot,
+ migrate_data_dirs,
+ resolve_config_file,
+ user_data_dir_pair,
+)
+from dodaios.core.identity_migration import (
+ DirectoryOutcome,
+ create_directory_link,
+ lock_file_held,
+ migrate_directory,
+ named_mutex_exists,
+)
+from dodaios.core.instance import INSTANCE_ENV_VAR
+
+_ROOT = Path(__file__).resolve().parents[3]
+
+
[email protected](autouse=True)
+def _fresh_resolution() -> Iterator[None]:
+ identity_boot.reset_resolution_cache()
+ yield
+ identity_boot.reset_resolution_cache()
+
+
+def local_appdata(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
+ """A per-user application data root, as on Windows."""
+ root = tmp_path / "AppData" / "Local"
+ root.mkdir(parents=True)
+ monkeypatch.setenv("LOCALAPPDATA", str(root))
+ monkeypatch.delenv(INSTANCE_ENV_VAR, raising=False)
+ monkeypatch.delenv(identity_boot.HOOK_REPORT_ENV_VAR, raising=False)
+ return root
+
+
+def legacy_dir(local_appdata: Path) -> Path:
+ """An installation from before the rename, holding real data."""
+ directory = local_appdata / branding.LEGACY_WINDOWS_USER_DATA_DIR_NAMES[0]
+ (directory / "memory").mkdir(parents=True)
+ (directory / "memory" / "notes.txt").write_text("remember this", encoding="utf-8")
+ return directory
+
+
+def current_dir(local_appdata: Path) -> Path:
+ return local_appdata / branding.WINDOWS_USER_DATA_DIR_NAME
+
+
+def linkable(tmp_path: Path) -> None:
+ """Skip where this account cannot leave a directory link at all."""
+ target = tmp_path / "link-probe-target"
+ link = tmp_path / "link-probe"
+ target.mkdir()
+ try:
+ create_directory_link(link, target)
+ except OSError as exc:
+ pytest.skip(f"this OS account cannot create a directory link: {exc}")
+ try:
+ os.unlink(link)
+ except OSError:
+ os.rmdir(link)
+
+
+def _main_instance(argv: tuple[str, ...] = ()) -> identity_boot.MigrationDecision:
+ """The decision for a source launch with no other instance running."""
+ return may_migrate(
+ argv, frozen=False, mutex_exists=lambda _names: False, lock_held=lambda _paths: False
+ )
+
+
+# ----------------------------------------------------------------------
+# Resolution
+# ----------------------------------------------------------------------
+
+
+def test_a_fresh_install_uses_the_current_name(local_appdata: Path, current_dir: Path) -> None:
+ assert paths.user_data_dir() == current_dir
+
+
+def test_the_legacy_directory_wins_while_it_is_a_real_directory(
+ legacy_dir: Path, current_dir: Path
+) -> None:
+ assert paths.user_data_dir() == legacy_dir
+ # Even beside a current directory that already exists: nothing is merged,
+ # and the data stays where it is.
+ current_dir.mkdir()
+ identity_boot.reset_resolution_cache()
+ assert paths.user_data_dir() == legacy_dir
+ assert paths.user_skills_dir() == legacy_dir / "skills"
+
+
+def test_the_home_directory_fallback_has_its_own_earlier_name(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ home = tmp_path / "home"
+ (home / ".jarvis").mkdir(parents=True)
+ monkeypatch.setattr(Path, "home", classmethod(lambda cls: home))
+ monkeypatch.delenv("LOCALAPPDATA", raising=False)
+ assert paths.user_data_dir() == home / ".jarvis"
+ (home / ".jarvis").rmdir()
+ identity_boot.reset_resolution_cache()
+ assert paths.user_data_dir() == home / branding.FALLBACK_USER_DATA_DIR_NAME
+
+
[email protected]("linkable")
+def test_a_link_left_at_the_legacy_path_resolves_to_the_current_directory(
+ local_appdata: Path, current_dir: Path
+) -> None:
+ current_dir.mkdir()
+ create_directory_link(local_appdata / "Jarvis", current_dir)
+ assert paths.user_data_dir() == current_dir
+
+
+def test_resolution_is_cached_per_process_until_reset(
+ local_appdata: Path, current_dir: Path
+) -> None:
+ assert paths.user_data_dir() == current_dir
+ legacy = local_appdata / "Jarvis"
+ legacy.mkdir()
+ # A cached answer: a later lookup costs no filesystem access at all.
+ assert paths.user_data_dir() == current_dir
+ identity_boot.reset_resolution_cache()
+ assert paths.user_data_dir() == legacy
+
+
+def test_resolving_changes_nothing_on_disk(legacy_dir: Path, local_appdata: Path) -> None:
+ before = sorted(p.name for p in local_appdata.iterdir())
+ paths.user_data_dir()
+ paths.desktop_mirror_dir()
+ assert sorted(p.name for p in local_appdata.iterdir()) == before
+
+
+def test_the_desktop_mirror_keeps_a_folder_under_its_earlier_name(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ home = tmp_path / "home"
+ monkeypatch.setattr(Path, "home", classmethod(lambda cls: home))
+ assert paths.desktop_mirror_dir() == home / "Desktop" / "Dodaios-Output"
+ (home / "Desktop" / "Jarvis-Output").mkdir(parents=True)
+ identity_boot.reset_resolution_cache()
+ assert paths.desktop_mirror_dir() == home / "Desktop" / "Jarvis-Output"
+
+
+def test_the_deliverables_folder_keeps_a_folder_under_its_earlier_name(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ from dodaios.missions.kontrollierer.deliverable import resolve_deliverables_dir
+
+ home = tmp_path / "home"
+ (home / "Downloads").mkdir(parents=True)
+ monkeypatch.setattr(Path, "home", classmethod(lambda cls: home))
+ if os.name == "nt":
+ parent, current, legacy = home / "Downloads", "Dodaios-Outputs", "Jarvis-Outputs"
+ else:
+ parent, current, legacy = home, "dodaios-outputs", "jarvis-outputs"
+ (parent / legacy).mkdir()
+ assert resolve_deliverables_dir() == parent / legacy
+ (parent / legacy).rmdir()
+ identity_boot.reset_resolution_cache()
+ assert resolve_deliverables_dir() == parent / current
+
+
+# ----------------------------------------------------------------------
+# Migration
+# ----------------------------------------------------------------------
+
+
[email protected]("linkable")
+def test_after_migration_both_paths_reach_the_same_files(
+ legacy_dir: Path, current_dir: Path
+) -> None:
+ assert paths.user_data_dir() == legacy_dir
+
+ results = migrate_data_dirs(wait_seconds=0.5)
+
+ assert [result.outcome for result in results] == [DirectoryOutcome.MIGRATED]
+ # The cache was cleared: every later lookup sees the move.
+ assert paths.user_data_dir() == current_dir
+ assert (current_dir / "memory" / "notes.txt").read_text(encoding="utf-8") == "remember this"
+ # A process that still spells the old name writes into the same directory.
+ (legacy_dir / "memory" / "from-old-spelling.txt").write_text("x", encoding="utf-8")
+ assert (current_dir / "memory" / "from-old-spelling.txt").is_file()
+ # And a second start has nothing left to do.
+ assert [r.outcome for r in migrate_data_dirs(wait_seconds=0.5)] == [
+ DirectoryOutcome.ALREADY_LINKED
+ ]
+ assert identity_boot.describe(migrate_data_dirs(wait_seconds=0.5)) is None
+
+
+def test_a_refused_rename_keeps_the_legacy_directory_in_use(
+ legacy_dir: Path, current_dir: Path
+) -> None:
+ def refuse(_source: Path, _target: Path) -> None:
+ raise PermissionError(13, "a file is open", str(_source))
+
+ refusing = functools.partial(migrate_directory, rename=refuse, retry_delays=())
+ results = migrate_data_dirs(wait_seconds=0.5, migrate=refusing)
+
+ assert [result.outcome for result in results] == [DirectoryOutcome.RENAME_FAILED]
+ assert not current_dir.exists()
+ assert paths.user_data_dir() == legacy_dir
+ assert (legacy_dir / "memory" / "notes.txt").is_file()
+ report = identity_boot.describe(results)
+ assert report is not None and report.level == "WARNING"
+ assert "rename_failed" in report.message
+
+
+def test_a_migration_that_raises_never_stops_the_boot(
+ legacy_dir: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ def explode(*_args: object, **_kwargs: object) -> None:
+ raise RuntimeError("disk on fire")
+
+ monkeypatch.setattr(identity_boot, "may_migrate", explode)
+
+ report = migrate_at_boot([])
+
+ assert report is not None and report.level == "WARNING"
+ assert "disk on fire" in report.message
+ assert paths.user_data_dir() == legacy_dir
+
+
[email protected]("linkable")
+def test_the_main_instance_migrates_at_boot(
+ legacy_dir: Path, current_dir: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ monkeypatch.setattr(identity_boot, "may_migrate", lambda argv, **_k: _main_instance(argv))
+
+ report = migrate_at_boot([])
+
+ assert report is not None and report.level == "INFO"
+ assert paths.user_data_dir() == current_dir
+
+
+def test_an_ordinary_start_asks_nothing_and_says_nothing(
+ local_appdata: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ def must_not_probe(*_args: object, **_kwargs: object) -> None:
+ raise AssertionError("an install with nothing to move probes no instance")
+
+ monkeypatch.setattr(identity_boot, "may_migrate", must_not_probe)
+ assert migrate_at_boot([]) is None
+
+
+# ----------------------------------------------------------------------
+# Who may migrate
+# ----------------------------------------------------------------------
+
+
+def test_the_default_instance_with_nothing_running_may_migrate(local_appdata: Path) -> None:
+ assert _main_instance()
+
+
+def test_the_dev_instance_only_resolves(
+ legacy_dir: Path, current_dir: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ monkeypatch.setenv(INSTANCE_ENV_VAR, "dev")
+ decision = _main_instance()
+ assert not decision and "dev" in decision.reason
+ assert migrate_at_boot([]) is None
+ assert legacy_dir.is_dir() and not current_dir.exists()
+
+
+def test_a_no_lock_run_only_resolves(legacy_dir: Path) -> None:
+ assert not _main_instance(("--headless", "--no-lock"))
+
+
+def test_the_frozen_build_leaves_it_to_its_runtime_hook(local_appdata: Path) -> None:
+ decision = may_migrate(
+ (), frozen=True, mutex_exists=lambda _n: False, lock_held=lambda _p: False
+ )
+ assert not decision
+
+
+def test_a_running_primary_on_windows_blocks_the_move(local_appdata: Path) -> None:
+ asked: list[tuple[str, ...]] = []
+
+ def running(names: tuple[str, ...]) -> bool:
+ asked.append(tuple(names))
+ return True
+
+ assert not may_migrate((), frozen=False, platform="win32", mutex_exists=running)
+ # Every instance's mutex counts: the dev app shares the data directory.
+ assert asked == [identity_boot.primary_mutex_names()]
+ assert branding.WINDOWS_MUTEX_NAME in asked[0]
+ assert f"{branding.WINDOWS_MUTEX_NAME}_dev" in asked[0]
+
+
+def test_a_held_lock_file_blocks_the_move_elsewhere(legacy_dir: Path) -> None:
+ lock = legacy_dir / "instance.lock"
+ lock.write_bytes(b"")
+ pairs = (DirectoryPair(legacy_dir.with_name("Dodaios"), (legacy_dir,)),)
+ probe = functools.partial(may_migrate, (), frozen=False, platform="linux", pairs=pairs)
+
+ assert probe(lock_held=lock_file_held)
+ holder = os.open(lock, os.O_RDWR)
+ try:
+ _lock(holder, hold=True)
+ assert not probe(lock_held=lock_file_held)
+ _lock(holder, hold=False)
+ finally:
+ os.close(holder)
+ assert probe(lock_held=lock_file_held)
+
+
+def _lock(fd: int, *, hold: bool) -> None:
+ """Take or drop the lock on ``fd`` the way a running primary holds its lock file."""
+ if sys.platform == "win32":
+ import msvcrt
+
+ os.lseek(fd, 0, os.SEEK_SET)
+ msvcrt.locking(fd, msvcrt.LK_NBLCK if hold else msvcrt.LK_UNLCK, 1)
+ else:
+ import fcntl
+
+ fcntl.flock(fd, (fcntl.LOCK_EX | fcntl.LOCK_NB) if hold else fcntl.LOCK_UN)
+
+
+def test_probing_a_lock_file_never_creates_one(tmp_path: Path) -> None:
+ missing = tmp_path / "Jarvis" / "instance.lock"
+ assert lock_file_held([missing]) is False
+ assert not missing.exists() and not missing.parent.exists()
+
+
[email protected](sys.platform != "win32", reason="named mutexes are a Windows object")
+def test_the_mutex_probe_sees_a_real_mutex_and_creates_none() -> None:
+ import ctypes
+ from ctypes import wintypes
+
+ kernel32 = ctypes.WinDLL("kernel32", use_last_error=True)
+ kernel32.CreateMutexW.argtypes = (wintypes.LPVOID, wintypes.BOOL, wintypes.LPCWSTR)
+ kernel32.CreateMutexW.restype = wintypes.HANDLE
+ name = f"Local\\DodaiosIdentityBootTest_{os.getpid()}"
+ assert named_mutex_exists([name]) is False
+ handle = kernel32.CreateMutexW(None, False, name)
+ assert handle
+ try:
+ assert named_mutex_exists([f"{name}_other", name]) is True
+ finally:
+ kernel32.CloseHandle(handle)
+ # The probe opened, never created: closing the only handle removed it.
+ assert named_mutex_exists([name]) is False
+
+
+def test_only_the_launcher_moves_the_data_directory() -> None:
+ """Helpers, the CLI and every other module only resolve.
+
+ The one caller of the migration is the desktop launcher (the frozen build
+ has its runtime hook); any other caller would move the directory from a
+ process that is not the primary instance.
+ """
+ callers: list[str] = []
+ for path in (_ROOT / "dodaios").rglob("*.py"):
+ relative = path.relative_to(_ROOT).as_posix()
+ if relative == "dodaios/core/identity_boot.py":
+ continue
+ source = path.read_text(encoding="utf-8-sig")
+ if "migrate_at_boot" not in source and "migrate_directory" not in source:
+ continue
+ for node in ast.walk(ast.parse(source)):
+ if isinstance(node, ast.Call):
+ func = node.func
+ name = func.attr if isinstance(func, ast.Attribute) else getattr(func, "id", "")
+ if name in {"migrate_at_boot", "migrate_data_dirs", "migrate_directory"}:
+ callers.append(relative)
+ callers = sorted(set(callers) - {"dodaios/core/identity_migration.py"})
+ assert callers == ["dodaios/ui/web/launcher.py"]
+
+
+def test_the_launcher_migrates_before_it_opens_anything_in_the_data_directory() -> None:
+ source = (_ROOT / "dodaios" / "ui" / "web" / "launcher.py").read_text(encoding="utf-8")
+ body = source[source.index("def _main(") :]
+ migrate = body.index("migrate_at_boot(_raw_argv)")
+ assert body.index("_select_instance_early(_raw_argv)") < migrate
+ for later in ("ensure_instance_data_dir(", "_install_boot_trace(_raw_argv)", "_parse_args("):
+ assert migrate < body.index(later), later
+
+
+# ----------------------------------------------------------------------
+# The runtime hook's report
+# ----------------------------------------------------------------------
+
+
+def test_the_hook_report_is_logged_once_and_not_inherited(
+ local_appdata: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ monkeypatch.setenv(identity_boot.HOOK_REPORT_ENV_VAR, "INFO|Data directory migration: moved")
+ report = migrate_at_boot([])
+ assert report == identity_boot.BootReport("INFO", "Data directory migration: moved")
+ assert identity_boot.HOOK_REPORT_ENV_VAR not in os.environ
+ assert migrate_at_boot([]) is None
+
+
+# ----------------------------------------------------------------------
+# Paths stored under the old spelling
+# ----------------------------------------------------------------------
+
+
+def test_a_path_inside_the_data_directory_has_every_spelling(
+ local_appdata: Path, current_dir: Path
+) -> None:
+ inside = current_dir / "outputs" / "run-1"
+ spellings = identity_boot.data_dir_spellings(inside)
+ assert spellings == (inside, local_appdata / "Jarvis" / "outputs" / "run-1")
+ old = local_appdata / "Jarvis" / "outputs" / "run-1"
+ assert identity_boot.data_dir_spellings(old) == (old, inside)
+ assert identity_boot.data_dir_spellings(current_dir) == (current_dir, local_appdata / "Jarvis")
+ outside = local_appdata / "Elsewhere" / "file"
+ assert identity_boot.data_dir_spellings(outside) == (outside,)
+ # A sibling whose name only starts like the data directory is outside it.
+ sibling = local_appdata / "Dodaios-Other"
+ assert identity_boot.data_dir_spellings(sibling) == (sibling,)
+
+
+def test_an_id_derived_from_a_path_survives_the_move(
+ local_appdata: Path, current_dir: Path
+) -> None:
+ from dodaios.agentic_ide.library import project_id_for
+
+ old = local_appdata / "Jarvis" / "scratch"
+ new = current_dir / "scratch"
+ assert identity_boot.stable_data_dir_spelling(new) == old
+ assert project_id_for(new) == project_id_for(old)
+ assert project_id_for(local_appdata / "Elsewhere") != project_id_for(old)
+
+
+# ----------------------------------------------------------------------
+# The config file
+# ----------------------------------------------------------------------
+
+
+def test_the_legacy_config_file_wins_while_it_exists(tmp_path: Path) -> None:
+ assert resolve_config_file(tmp_path) == tmp_path / "dodaios.toml"
+ (tmp_path / "dodaios.toml").write_text("", encoding="utf-8")
+ assert resolve_config_file(tmp_path) == tmp_path / "dodaios.toml"
+ (tmp_path / "jarvis.toml").write_text("", encoding="utf-8")
+ assert resolve_config_file(tmp_path) == tmp_path / "jarvis.toml"
+ assert core_config.resolve_config_file is resolve_config_file
+
+
+def test_a_directory_named_like_the_config_file_is_not_one(tmp_path: Path) -> None:
+ (tmp_path / "jarvis.toml").mkdir()
+ assert resolve_config_file(tmp_path) == tmp_path / "dodaios.toml"
+
+
+def test_the_config_module_reads_the_resolved_file(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.delenv("JARVIS_CONFIG", raising=False)
+ assert core_config.DEFAULT_CONFIG_FILE == resolve_config_file(core_config.PROJECT_ROOT)
+ assert core_config.resolve_config_path() == core_config.DEFAULT_CONFIG_FILE
+
+
+def test_the_writer_writes_to_jarvis_toml_when_only_it_exists(tmp_path: Path) -> None:
+ from dodaios.core import config_writer
+
+ legacy = tmp_path / "jarvis.toml"
+ legacy.write_text('# my settings\n[ui]\ntheme = "light"\n', encoding="utf-8")
+
+ config_writer.set_ui_theme("dark", path=resolve_config_file(tmp_path))
+
+ text = legacy.read_text(encoding="utf-8")
+ assert 'theme = "dark"' in text and "# my settings" in text
+ assert not (tmp_path / "dodaios.toml").exists()
+
+
+def test_a_fresh_install_writes_dodaios_toml(tmp_path: Path) -> None:
+ from dodaios.core import config_writer
+
+ config_writer.set_ui_theme("dark", path=resolve_config_file(tmp_path))
+
+ assert 'theme = "dark"' in (tmp_path / "dodaios.toml").read_text(encoding="utf-8")
+ assert not (tmp_path / "jarvis.toml").exists()
+
+
+def test_every_config_name_is_listed_legacy_first() -> None:
+ assert identity_boot.config_file_names() == ("jarvis.toml", "dodaios.toml")
+
+
+def test_the_data_directory_pair_follows_branding(local_appdata: Path) -> None:
+ pair = user_data_dir_pair()
+ assert pair.current == local_appdata / branding.WINDOWS_USER_DATA_DIR_NAME
+ assert pair.legacy == tuple(
+ local_appdata / name for name in branding.LEGACY_WINDOWS_USER_DATA_DIR_NAMES
+ )
diff --git a/tests/unit/core/test_identity_credentials.py b/tests/unit/core/test_identity_credentials.py
new file mode 100644
index 0000000000..f9cac1d7fb
--- /dev/null
+++ b/tests/unit/core/test_identity_credentials.py
@@ -0,0 +1,323 @@
+"""The one-time copy of stored credentials from the legacy service to the current one.
+
+``dodaios.core.identity_credentials`` copies over each store ``get_secret``
+reads: the platform keyring (on macOS one vault write) and the 0600 file
+store. It never overwrites a current value, never writes or deletes a legacy
+entry, marks the work done, and runs in the background of the main instance
+only. Every store here is a fake.
+"""
+
+from __future__ import annotations
+
+import sys
+import threading
+from collections.abc import Iterator
+from pathlib import Path
+
+import keyring
+import pytest
+
+from dodaios.core import config as c
+from dodaios.core import identity_credentials as ic
+from dodaios.core import secret_slots
+from dodaios.core.identity_migration import keyring_marker_key
+from dodaios.core.keychain_bundle import (
+ VAULT_ACCOUNT,
+ DarwinBundleKeyringBackend,
+ VaultCopyOutcome,
+)
+from tests.fakes.fake_keychain_vault import (
+ FakePerItemKeychain,
+ FakeSecurityCli,
+ read_payload,
+ vault_payload,
+)
+from tests.fakes.fake_platform_keyring import FakePlatformKeyring
+
+CURRENT = c.KEYRING_SERVICE
+LEGACY = c.LEGACY_KEYRING_SERVICES[0]
+MARKER = keyring_marker_key(LEGACY)
+KNOWN = "telegram_bot_token"
+DYNAMIC = "computer_password_0f3c"
+
+
+def stores(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Iterator[None]:
+ monkeypatch.setattr(sys, "platform", "linux")
+ monkeypatch.delenv("JARVIS_DATA_DIR", raising=False)
+ monkeypatch.setattr(c, "DATA_DIR", tmp_path)
+ monkeypatch.setattr(c, "_KEYRING_BACKEND_READY", True)
+ monkeypatch.setattr(c, "_FILE_BACKEND_ACTIVE", False)
+ monkeypatch.setattr(c, "_PLATFORM_KEYRING_BACKEND", None)
+ # The listed runtime names: one computer password, nothing read from disk.
+ monkeypatch.setattr(secret_slots, "dynamic_secret_keys", lambda: frozenset({DYNAMIC}))
+ original = keyring.get_keyring()
+ try:
+ yield
+ finally:
+ keyring.set_keyring(original)
+
+
+def platform(stores: None) -> FakePlatformKeyring:
+ fake = FakePlatformKeyring()
+ keyring.set_keyring(fake)
+ return fake
+
+
+def _by_store(results: tuple[ic.StoreMigration, ...]) -> dict[str, ic.StoreMigration]:
+ return {result.store: result for result in results}
+
+
+# ---------------------------------------------------------------- platform store
+
+
+def test_known_and_listed_runtime_keys_are_copied_once(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, KNOWN)] = "bot-token"
+ platform.entries[(LEGACY, DYNAMIC)] = "ssh-password"
+ assert KNOWN in secret_slots.KNOWN_SECRET_KEYS
+
+ first = _by_store(ic.migrate_credentials())["platform"]
+
+ assert first.outcome == "migrated"
+ assert set(first.copied) == {KNOWN, DYNAMIC}
+ assert platform.entries[(CURRENT, KNOWN)] == "bot-token"
+ assert platform.entries[(CURRENT, DYNAMIC)] == "ssh-password"
+ assert platform.entries[(CURRENT, MARKER)] == "1"
+ # The legacy entries stay: they are the way back for a downgrade.
+ assert platform.service(LEGACY) == {KNOWN: "bot-token", DYNAMIC: "ssh-password"}
+ assert platform.writes(LEGACY) == []
+
+ platform.calls.clear()
+ second = _by_store(ic.migrate_credentials())["platform"]
+
+ assert second.outcome == "already_migrated"
+ assert platform.calls == [("get", CURRENT, MARKER)] # one read, nothing else
+
+
+def test_a_current_value_is_never_overwritten(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, KNOWN)] = "old"
+ platform.entries[(CURRENT, KNOWN)] = "saved-after-the-rename"
+
+ result = _by_store(ic.migrate_credentials())["platform"]
+
+ assert result.kept == (KNOWN,)
+ assert platform.entries[(CURRENT, KNOWN)] == "saved-after-the-rename"
+
+
+def test_explicit_keys_replace_the_slot_listing(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, "custom_slot")] = "v"
+ platform.entries[(LEGACY, KNOWN)] = "not-listed-this-time"
+
+ result = _by_store(ic.migrate_credentials(keys=["custom_slot"]))["platform"]
+
+ assert result.copied == ("custom_slot",)
+ assert (CURRENT, KNOWN) not in platform.entries
+
+
+def test_a_failed_copy_leaves_no_marker_and_is_finished_next_time(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ platform.entries[(LEGACY, KNOWN)] = "bot-token"
+ platform.entries[(LEGACY, DYNAMIC)] = "ssh-password"
+ real_set = platform.set_password
+
+ def flaky(service: str, username: str, password: str) -> None:
+ if username == DYNAMIC:
+ raise RuntimeError("store busy")
+ real_set(service, username, password)
+
+ monkeypatch.setattr(platform, "set_password", flaky)
+ first = _by_store(ic.migrate_credentials())["platform"]
+ assert first.outcome == "incomplete"
+ assert first.failed == (DYNAMIC,)
+ assert (CURRENT, MARKER) not in platform.entries
+
+ monkeypatch.setattr(platform, "set_password", real_set)
+ second = _by_store(ic.migrate_credentials())["platform"]
+ assert second.outcome == "migrated"
+ assert second.copied == (DYNAMIC,)
+ assert second.kept == (KNOWN,)
+
+
+def test_a_process_on_the_file_backend_does_not_copy_into_the_platform(
+ platform: FakePlatformKeyring,
+) -> None:
+ platform.entries[(LEGACY, KNOWN)] = "bot-token"
+ assert c._install_file_cred_backend("test: platform failed")
+
+ results = _by_store(ic.migrate_credentials())
+
+ assert "platform" not in results
+ assert platform.writes(CURRENT) == []
+ # Still readable meanwhile, through the legacy fallback.
+ assert c.get_secret(KNOWN) == "bot-token"
+
+
+# ---------------------------------------------------------------- file store
+
+
+def test_the_file_store_copies_every_legacy_entry_it_holds(
+ platform: FakePlatformKeyring,
+) -> None:
+ store = c._FileCredStore()
+ store.set(LEGACY, "routine_webhook_7_123", "hook-token") # a name nothing lists
+ store.set(LEGACY, KNOWN, "bot-token")
+
+ first = _by_store(ic.migrate_credentials())["file"]
+
+ assert first.outcome == "migrated"
+ assert set(first.copied) == {"routine_webhook_7_123", KNOWN}
+ assert store.get(CURRENT, "routine_webhook_7_123") == "hook-token"
+ assert store.get(CURRENT, MARKER) == "1"
+ assert store.get(LEGACY, KNOWN) == "bot-token"
+
+ second = _by_store(ic.migrate_credentials())["file"]
+ assert second.outcome == "already_migrated"
+
+
+def test_no_file_store_is_created_when_it_holds_nothing_legacy(
+ platform: FakePlatformKeyring, tmp_path: Path
+) -> None:
+ results = _by_store(ic.migrate_credentials())
+
+ assert "file" not in results
+ assert not (tmp_path / "credentials.json").exists()
+
+
+# ---------------------------------------------------------------- macOS vault
+
+
+def vault(stores: None) -> tuple[DarwinBundleKeyringBackend, FakeSecurityCli, FakePerItemKeychain]:
+ inner = FakePerItemKeychain()
+ cli = FakeSecurityCli()
+ backend = DarwinBundleKeyringBackend(inner, cli=cli)
+ keyring.set_keyring(backend)
+ return backend, cli, inner
+
+
+def test_the_vault_is_copied_in_one_write_with_the_marker(vault) -> None: # noqa: ANN001
+ _backend, cli, inner = vault
+ legacy_entries = {KNOWN: "bot-token", "society_credential.a1.TOKEN": "s3cret"}
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = vault_payload(legacy_entries)
+
+ results = _by_store(ic.migrate_credentials())
+
+ assert results["keychain-vault"].outcome == VaultCopyOutcome.COPIED.value
+ assert set(results["keychain-vault"].copied) == set(legacy_entries)
+ assert "platform" not in results # no per-key pass after a vault copy
+ assert cli.writes(CURRENT) == [VAULT_ACCOUNT] # one write, no prompt per key
+ assert read_payload(cli.items[(CURRENT, VAULT_ACCOUNT)]) == {**legacy_entries, MARKER: "1"}
+ assert cli.writes(LEGACY) == []
+ assert inner.calls == []
+ assert c.get_secret("society_credential.a1.TOKEN", "") == "s3cret"
+
+ cli.calls.clear()
+ again = _by_store(ic.migrate_credentials())
+ assert again["keychain-vault"].outcome == VaultCopyOutcome.ALREADY_COPIED.value
+ assert cli.writes(CURRENT) == []
+
+
+def test_a_vault_copy_keeps_values_saved_under_the_new_name(vault) -> None: # noqa: ANN001
+ _backend, cli, _inner = vault
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = vault_payload({KNOWN: "old", "zai_api_key": "z"})
+ cli.items[(CURRENT, VAULT_ACCOUNT)] = vault_payload({KNOWN: "new"})
+
+ results = _by_store(ic.migrate_credentials())
+
+ assert results["keychain-vault"].copied == ("zai_api_key",)
+ assert read_payload(cli.items[(CURRENT, VAULT_ACCOUNT)]) == {
+ KNOWN: "new",
+ "zai_api_key": "z",
+ MARKER: "1",
+ }
+
+
+def test_per_item_legacy_entries_are_copied_when_there_is_no_legacy_vault(
+ vault, # noqa: ANN001
+) -> None:
+ _backend, cli, inner = vault
+ inner.values[(LEGACY, KNOWN)] = "from-before-the-vault"
+
+ results = _by_store(ic.migrate_credentials())
+
+ assert results["keychain-vault"].outcome == VaultCopyOutcome.NO_LEGACY_VAULT.value
+ assert results["platform"].copied == (KNOWN,)
+ assert read_payload(cli.items[(CURRENT, VAULT_ACCOUNT)])[KNOWN] == "from-before-the-vault"
+ # The legacy item is read, never folded into a legacy vault or deleted.
+ assert inner.writes(LEGACY) == []
+ assert cli.writes(LEGACY) == []
+
+
+def test_a_malformed_legacy_vault_is_left_alone(vault) -> None: # noqa: ANN001
+ _backend, cli, _inner = vault
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = "not a vault"
+
+ results = _by_store(ic.migrate_credentials())
+
+ assert results["keychain-vault"].outcome == VaultCopyOutcome.MALFORMED.value
+ assert cli.items[(LEGACY, VAULT_ACCOUNT)] == "not a vault"
+ assert cli.writes(LEGACY) == []
+
+
+# ---------------------------------------------------------------- the read-only view
+
+
+def test_the_copy_can_never_write_or_delete_the_legacy_service() -> None:
+ fake = FakePlatformKeyring()
+ view = ic._LegacyReadOnly(fake, LEGACY)
+
+ with pytest.raises(PermissionError):
+ view.set_password(LEGACY, KNOWN, "x")
+ with pytest.raises(PermissionError):
+ view.delete_password(CURRENT, KNOWN)
+ view.set_password(CURRENT, KNOWN, "x")
+ assert fake.service(CURRENT) == {KNOWN: "x"}
+
+
+# ---------------------------------------------------------------- scheduling
+
+
+def recorded_runs(monkeypatch: pytest.MonkeyPatch) -> list[str]:
+ runs: list[str] = []
+ monkeypatch.setattr(ic, "_scheduled", False)
+ monkeypatch.setattr(ic, "migrate_credentials", lambda: runs.append("ran") or ())
+ return runs
+
+
+def test_only_the_main_instance_schedules_the_copy(recorded_runs: list[str]) -> None:
+ assert ic.schedule_credential_migration(delay_s=0, environ={}) is None
+ assert ic.schedule_credential_migration(
+ delay_s=0, environ={"JARVIS_PRIMARY_INSTANCE": "0"}
+ ) is None
+ assert recorded_runs == []
+
+
+def test_the_copy_runs_once_in_a_background_daemon_thread(recorded_runs: list[str]) -> None:
+ primary = {"JARVIS_PRIMARY_INSTANCE": "1"}
+
+ thread = ic.schedule_credential_migration(delay_s=0, environ=primary)
+
+ assert isinstance(thread, threading.Thread)
+ assert thread.daemon and thread is not threading.current_thread()
+ thread.join(timeout=10)
+ assert recorded_runs == ["ran"]
+ assert ic.schedule_credential_migration(delay_s=0, environ=primary) is None
+
+
+def test_a_failing_copy_never_escapes_the_thread(monkeypatch: pytest.MonkeyPatch) -> None:
+ def boom() -> tuple[()]:
+ raise RuntimeError("store exploded")
+
+ monkeypatch.setattr(ic, "_scheduled", False)
+ monkeypatch.setattr(ic, "migrate_credentials", boom)
+ seen: list[BaseException] = []
+ monkeypatch.setattr(threading, "excepthook", lambda args: seen.append(args.exc_value))
+
+ thread = ic.schedule_credential_migration(delay_s=0, environ={"JARVIS_PRIMARY_INSTANCE": "1"})
+ assert thread is not None
+ thread.join(timeout=10)
+
+ assert seen == []
diff --git a/tests/unit/core/test_identity_migration.py b/tests/unit/core/test_identity_migration.py
index 31237bd600..c2342b8d2f 100644
--- a/tests/unit/core/test_identity_migration.py
+++ b/tests/unit/core/test_identity_migration.py
@@ -1188,22 +1188,6 @@ def test_the_engine_imports_only_the_standard_library() -> None:
assert imported <= set(sys.stdlib_module_names), imported - set(sys.stdlib_module_names)
-def test_the_engine_is_not_wired_into_the_runtime() -> None:
- """Inert until the identity actually changes: nothing in the product imports it.
-
- The change that switches the persistent identifiers wires the engine in
- and deletes this test.
- """
- package = MODULE_PATH.parents[1]
- importers = [
- path.relative_to(package).as_posix()
- for path in package.rglob("*.py")
- if path != MODULE_PATH and "identity_migration" in path.read_text(encoding="utf-8")
- ]
-
- assert importers == []
-
-
# ----------------------------------------------------------------------
# Keyring migration
# ----------------------------------------------------------------------
@@ -1434,3 +1418,133 @@ def test_no_secret_value_reaches_the_result_or_a_log_line(
assert "secret" not in repr(result)
assert "secret" not in caplog.text
assert "beta_api_key" in caplog.text
+
+
+# ----------------------------------------------------------------------
+# Command line: what the shell installers run
+# ----------------------------------------------------------------------
+
+
+def _cli(
+ tmp_path: Path, *args: str, capsys: pytest.CaptureFixture[str]
+) -> tuple[int, dict[str, str] | None, str]:
+ code = engine.main(list(args))
+ captured = capsys.readouterr()
+ report = json.loads(captured.out) if captured.out.strip() else None
+ return code, report, captured.err
+
+
+def test_the_cli_migrates_and_reports_the_directory_to_use(
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
+) -> None:
+ legacy, current = tmp_path / LEGACY_NAME, tmp_path / CURRENT_NAME
+ files = _populate(legacy)
+
+ code, report, _err = _cli(tmp_path, "migrate", str(legacy), str(current), capsys=capsys)
+
+ assert code == 0
+ assert report == {"outcome": "migrated", "effective": str(current)}
+ assert _snapshot(current) == files
+ assert inspect_legacy(legacy, current) is LegacyState.LINK_TO_CURRENT
+
+
+def test_the_cli_reports_a_refusal_as_a_state_to_go_on_from(
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
+) -> None:
+ legacy, current = tmp_path / LEGACY_NAME, tmp_path / CURRENT_NAME
+ _populate(legacy)
+ current.mkdir()
+
+ code, report, _err = _cli(tmp_path, "migrate", str(legacy), str(current), capsys=capsys)
+
+ assert code == 0
+ assert report == {"outcome": "both_exist", "effective": str(legacy)}
+
+
[email protected]("moved", [False, True])
+def test_the_cli_resolves_without_moving_anything(
+ tmp_path: Path, capsys: pytest.CaptureFixture[str], moved: bool
+) -> None:
+ legacy, current = tmp_path / LEGACY_NAME, tmp_path / CURRENT_NAME
+ _populate(legacy)
+ if moved:
+ migrate_directory(legacy, current)
+
+ code, report, _err = _cli(tmp_path, "resolve", str(legacy), str(current), capsys=capsys)
+
+ assert code == 0
+ assert report == {"outcome": "resolved", "effective": str(current if moved else legacy)}
+ assert legacy.is_dir()
+ assert current.exists() is moved
+
+
+ "args",
+ [(), ("migrate",), ("migrate", "a"), ("move", "a", "b"), ("migrate", "", "b"),
+ ("migrate", "a", "b", "c")],
+)
+def test_the_cli_refuses_a_malformed_command_line_and_prints_nothing(
+ tmp_path: Path, capsys: pytest.CaptureFixture[str], args: tuple[str, ...]
+) -> None:
+ code, report, err = _cli(tmp_path, *args, capsys=capsys)
+
+ assert code == 2
+ assert report is None
+ assert "usage:" in err
+
+
+def test_the_cli_output_is_ascii_whatever_the_path(
+ tmp_path: Path, capsys: pytest.CaptureFixture[str]
+) -> None:
+ legacy, current = tmp_path / "Old Café", tmp_path / "New ø"
+ _populate(legacy)
+
+ engine.main(["migrate", str(legacy), str(current)])
+ out = capsys.readouterr().out
+
+ out.encode("ascii")
+ assert json.loads(out)["effective"] == str(current)
+
+
+def test_the_installers_copy_of_the_engine_runs_as_a_program(tmp_path: Path) -> None:
+ """Exactly as install.sh and install.ps1 run it: a copy outside both
+ directories, isolated (-I), no bytecode (-B), from another directory."""
+ copy = tmp_path / "engine-copy" / "dodaios-identity-migration.tmp"
+ copy.parent.mkdir()
+ copy.write_bytes(MODULE_PATH.read_bytes())
+ home = tmp_path / "home"
+ legacy, current = home / ".old-install", home / ".new-install"
+ files = _populate(legacy)
+
+ done = subprocess.run( # noqa: S603 - test-controlled command
+ [sys.executable, "-I", "-B", str(copy), "migrate", str(legacy), str(current)],
+ cwd=str(home),
+ capture_output=True,
+ text=True,
+ timeout=60,
+ check=False,
+ creationflags=NO_WINDOW_CREATIONFLAGS,
+ )
+
+ assert done.returncode == 0, done.stderr
+ assert json.loads(done.stdout) == {"outcome": "migrated", "effective": str(current)}
+ assert _snapshot(current) == files
+ # Nothing was written beside the copy: no bytecode cache, no journal.
+ assert sorted(p.name for p in copy.parent.iterdir()) == [copy.name]
+
+
+def test_the_engine_source_is_ascii() -> None:
+ MODULE_PATH.read_bytes().decode("ascii")
+
+
[email protected]("kind", ["link", "real", "missing"])
+def test_is_directory_link_never_follows(tmp_path: Path, kind: str) -> None:
+ target = tmp_path / "target"
+ target.mkdir()
+ path = tmp_path / "probe"
+ if kind == "link":
+ create_directory_link(path, target)
+ elif kind == "real":
+ path.mkdir()
+
+ assert engine.is_directory_link(path) is (kind == "link")
diff --git a/tests/unit/core/test_identity_single_source.py b/tests/unit/core/test_identity_single_source.py
index e5ce462be7..6d13bb0191 100644
--- a/tests/unit/core/test_identity_single_source.py
+++ b/tests/unit/core/test_identity_single_source.py
@@ -26,6 +26,7 @@ import pytest
import dodaios.core.branding as branding
from dodaios.core import config as core_config
+from dodaios.core import identity_boot
from dodaios.core.instance import (
DATA_DIR_ENV_VAR,
DEV_INSTANCE_NAME,
@@ -65,10 +66,16 @@ def _module_constant(relative_path: str, name: str) -> object:
"relative_path",
["dodaios/plugins/stt/deepgram_api.py", "dodaios/plugins/stt/groq_api.py"],
)
-def test_a_plugin_reads_keys_from_the_hosts_keyring_service(relative_path: str) -> None:
+def test_a_plugin_reads_keys_from_the_hosts_keyring_services(relative_path: str) -> None:
assert _module_constant(relative_path, "_KEYRING_SERVICE") == branding.KEYRING_SERVICE_NAME
- # The named constant is the only spelling: no second literal beside it.
- assert _read(relative_path).count(f'"{branding.KEYRING_SERVICE_NAME}"') == 1
+ assert (
+ _module_constant(relative_path, "_LEGACY_KEYRING_SERVICES")
+ == branding.LEGACY_KEYRING_SERVICE_NAMES
+ )
+ # The named constants are the only spellings: no second literal beside them.
+ source = _read(relative_path)
+ for service in (branding.KEYRING_SERVICE_NAME, *branding.LEGACY_KEYRING_SERVICE_NAMES):
+ assert source.count(f'"{service}"') == 1, service
@pytest.mark.parametrize(
@@ -88,20 +95,59 @@ def test_a_plugin_attributes_requests_to_the_official_repository(relative_path:
("name", "expected"),
[
("_WINDOWS_USER_DATA_DIR_NAME", branding.WINDOWS_USER_DATA_DIR_NAME),
+ ("_LEGACY_WINDOWS_USER_DATA_DIR_NAMES", branding.LEGACY_WINDOWS_USER_DATA_DIR_NAMES),
("_FALLBACK_USER_DATA_DIR_NAME", branding.FALLBACK_USER_DATA_DIR_NAME),
+ ("_LEGACY_FALLBACK_USER_DATA_DIR_NAMES", branding.LEGACY_FALLBACK_USER_DATA_DIR_NAMES),
("_CONFIG_FILE_NAME", branding.CONFIG_FILE_NAME),
+ ("_LEGACY_CONFIG_FILE_NAMES", branding.LEGACY_CONFIG_FILE_NAMES),
+ ("_MUTEX_NAMES", identity_boot.primary_mutex_names()),
+ ("_REPORT_ENV_VAR", identity_boot.HOOK_REPORT_ENV_VAR),
],
)
-def test_the_frozen_runtime_hook_restates_the_directory_names(name: str, expected: str) -> None:
+def test_the_frozen_runtime_hook_restates_the_directory_names(name: str, expected: object) -> None:
assert _module_constant("packaging/pyinstaller_rthook_frozen.py", name) == expected
+def test_the_frozen_runtime_hook_restates_the_lock_files_and_launcher_names() -> None:
+ hook_path = "packaging/pyinstaller_rthook_frozen.py"
+ assert _load_runtime_hook()._PRIMARY_LOCK_FILES == identity_boot.PRIMARY_LOCK_FILES
+ # Every executable that is the desktop app may migrate, under its current
+ # and its earlier names; nothing else.
+ windows_names = (
+ branding.WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
+ *branding.LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ )
+ gui_names = {
+ branding.MACOS_EXECUTABLE_NAME,
+ *branding.LEGACY_MACOS_EXECUTABLE_NAMES,
+ *(name.removesuffix(".exe") for name in windows_names),
+ _module_constant("jarvis.spec", "GUI_EXE_NAME"),
+ *_module_constant("jarvis.spec", "LEGACY_GUI_EXE_NAMES"),
+ }
+ assert set(_module_constant(hook_path, "_GUI_EXE_NAMES")) == gui_names
+ # The bundle seeds a first-run config from the file jarvis.spec ships.
+ bundled = _module_constant(hook_path, "_BUNDLED_CONFIG_FILE_NAME")
+ assert f'datas.append((str(PROJECT_ROOT / "{bundled}"), "."))' in _read("jarvis.spec")
+ # And the engine it loads by path is shipped as a plain file.
+ engine = "/".join(_module_constant(hook_path, "_ENGINE_PATH"))
+ assert f'(str(PROJECT_ROOT / "{engine}"), "dodaios/core")' in _read("jarvis.spec")
+ assert (_ROOT / engine).is_file()
+
+
def test_the_pyinstaller_spec_restates_the_bundle_names() -> None:
assert _module_constant("jarvis.spec", "GUI_EXE_NAME") == branding.MACOS_EXECUTABLE_NAME
assert (
f'{_module_constant("jarvis.spec", "GUI_EXE_NAME")}.exe'
== branding.WINDOWS_BRANDED_LAUNCHER_FILE_NAME
)
+ # The windowed launcher ships under its earlier name too: pins, logon tasks
+ # and shortcuts of earlier releases start that file.
+ legacy_gui = _module_constant("jarvis.spec", "LEGACY_GUI_EXE_NAMES")
+ assert legacy_gui == branding.LEGACY_MACOS_EXECUTABLE_NAMES
+ assert tuple(f"{name}.exe" for name in legacy_gui) == (
+ branding.LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES
+ )
+ assert "*legacy_gui_exes," in _read("jarvis.spec")
assert _module_constant("jarvis.spec", "CLI_EXE_NAME") == branding.CLI_COMMAND_NAME
# The frozen build keeps the command's first earlier name beside the new one.
legacy_exes = _module_constant("jarvis.spec", "LEGACY_CLI_EXE_NAMES")
@@ -122,6 +168,7 @@ _RESTATEMENTS_ALLOWED = {
"dodaios/core/branding.py": "the single source",
"dodaios/plugins/stt/deepgram_api.py": "plugin without dodaios.* imports, pinned above",
"dodaios/plugins/stt/groq_api.py": "plugin without dodaios.* imports, pinned above",
+ "packaging/pyinstaller_rthook_frozen.py": "runtime hook, no dodaios.* imports, pinned above",
"dodaios/agent_runtimes/acp.py": "ACP client name, an identifier of its own",
"dodaios/agentic_ide/github_link.py": "HTTP user agent, an identifier of its own",
"dodaios/brain/identity.py": "the former product name told to a model",
@@ -153,8 +200,12 @@ def _shipped_python_files() -> list[Path]:
def test_no_module_restates_an_identity_value() -> None:
values = _distinctive_identity_values()
- assert branding.KEYRING_SERVICE_NAME in values
+ assert branding.LEGACY_KEYRING_SERVICE_NAMES[0] in values
assert branding.MACOS_BUNDLE_ID in values
+ # The current credential service is the bare product word, which is also
+ # the package, the command and the MCP server name: a literal equal to it
+ # is no evidence of a copy. Store calls are checked for it by the next test.
+ assert branding.KEYRING_SERVICE_NAME not in values
offenders: list[str] = []
for path in _shipped_python_files():
relative = path.relative_to(_ROOT).as_posix()
@@ -172,25 +223,69 @@ def test_no_module_restates_an_identity_value() -> None:
assert not offenders, "import the constant from dodaios.core.branding:\n" + "\n".join(offenders)
+_STORE_CALLS = frozenset({"get_password", "set_password", "delete_password", "peek_password"})
+
+
+def _store_calls_naming_a_service(source: str, services: frozenset[str]) -> list[int]:
+ """Lines where a credential-store call spells one of ``services`` as a literal."""
+ lines: list[int] = []
+ for node in ast.walk(ast.parse(source)):
+ if not (isinstance(node, ast.Call) and node.args):
+ continue
+ callee = node.func.attr if isinstance(node.func, ast.Attribute) else None
+ first = node.args[0]
+ if callee in _STORE_CALLS and isinstance(first, ast.Constant) and first.value in services:
+ lines.append(node.lineno)
+ return lines
+
+
+def test_no_credential_store_call_spells_a_service_name() -> None:
+ services = frozenset({branding.KEYRING_SERVICE_NAME, *branding.LEGACY_KEYRING_SERVICE_NAMES})
+ offenders: list[str] = []
+ for path in _shipped_python_files():
+ relative = path.relative_to(_ROOT).as_posix()
+ if relative in _RESTATEMENTS_ALLOWED:
+ continue
+ source = path.read_text(encoding="utf-8-sig")
+ offenders += [
+ f"{relative}:{line}" for line in _store_calls_naming_a_service(source, services)
+ ]
+ assert not offenders, "use dodaios.core.config.KEYRING_SERVICE: " + ", ".join(offenders)
+ # And the check has teeth.
+ probe = f'keyring.get_password("{branding.KEYRING_SERVICE_NAME}", "slot")'
+ assert _store_calls_naming_a_service(probe, services) == [1]
+
+
# ---------------------------------------------------------------------------
# Scripts, packaging and project metadata
# ---------------------------------------------------------------------------
-def test_the_installers_default_to_the_branded_install_directory() -> None:
- name = re.escape(branding.DEFAULT_INSTALL_DIR_NAME)
- shell = re.search(
- r'^INSTALL_DIR="\$\{JARVIS_INSTALL_DIR:-\$HOME/(?P<name>[^}"]+)\}"$',
- _read("install/install.sh"),
- re.MULTILINE,
- )
- assert shell is not None and re.fullmatch(name, shell.group("name"))
- powershell = re.search(
- r"^\$InstallDir = .*Join-Path \$env:USERPROFILE '(?P<name>[^']+)' \}$",
- _read("install/install.ps1"),
- re.MULTILINE,
- )
- assert powershell is not None and re.fullmatch(name, powershell.group("name"))
+ ("relative_path", "current", "legacy"),
+ [
+ ("install/install.sh", 'DEFAULT_INSTALL_DIR_NAME="{}"', 'LEGACY_INSTALL_DIR_NAME="{}"'),
+ ("install/uninstall.sh", 'DEFAULT_INSTALL_DIR_NAME="{}"', 'LEGACY_INSTALL_DIR_NAME="{}"'),
+ ("install/install.ps1", "$DefaultInstallDirName = '{}'", "$LegacyInstallDirName = '{}'"),
+ ("install/uninstall.ps1", "$DefaultInstallDirName = '{}'", "$LegacyInstallDirName = '{}'"),
+ ],
+)
+def test_the_scripts_restate_the_install_directory_names(
+ relative_path: str, current: str, legacy: str
+) -> None:
+ # Each script names the current folder and the one earlier name it still
+ # recognises; there is one earlier name, so one variable carries it.
+ assert branding.LEGACY_DEFAULT_INSTALL_DIR_NAMES == (".personal-jarvis",)
+ lines = _read(relative_path).splitlines()
+ assert current.format(branding.DEFAULT_INSTALL_DIR_NAME) in lines
+ assert legacy.format(branding.LEGACY_DEFAULT_INSTALL_DIR_NAMES[0]) in lines
+
+
+def test_the_installers_read_the_migration_engine_from_where_it_lives() -> None:
+ engine = "dodaios/core/identity_migration.py"
+ assert (_ROOT / engine).is_file()
+ assert f'IDENTITY_ENGINE_PATH="{engine}"' in _read("install/install.sh").splitlines()
+ assert f"$IdentityEnginePath = '{engine}'" in _read("install/install.ps1").splitlines()
@pytest.mark.parametrize(
@@ -206,6 +301,22 @@ def test_the_shell_uninstaller_restates_the_macos_identifiers(
assert f'\n{variable}="{expected}"\n' in _read("install/uninstall.sh")
+def test_the_shell_uninstaller_restates_both_bundle_names() -> None:
+ script = _read("install/uninstall.sh")
+ assert f'\nMACOS_APP_DIR_NAME="{branding.MACOS_APP_DIR_NAME}"\n' in script
+ assert branding.LEGACY_MACOS_APP_DIR_NAMES == ("Personal Jarvis.app",)
+ legacy = branding.LEGACY_MACOS_APP_DIR_NAMES[0]
+ assert f'\nLEGACY_MACOS_APP_DIR_NAME="{legacy}"\n' in script
+ assert 'for app_dir_name in "$MACOS_APP_DIR_NAME" "$LEGACY_MACOS_APP_DIR_NAME"; do' in script
+
+
+def test_the_shell_uninstaller_names_every_credential_service() -> None:
+ script = _read("install/uninstall.sh")
+ assert f'\nKEYRING_SERVICE_NAME="{branding.KEYRING_SERVICE_NAME}"\n' in script
+ legacy = " ".join(branding.LEGACY_KEYRING_SERVICE_NAMES)
+ assert f'\nLEGACY_KEYRING_SERVICE_NAMES="{legacy}"\n' in script
+
+
@pytest.mark.parametrize(
("definition", "expected"),
[
@@ -214,6 +325,9 @@ def test_the_shell_uninstaller_restates_the_macos_identifiers(
("CliExeName", f"{branding.CLI_COMMAND_NAME}.exe"),
("LegacyCliExeName", f"{branding.LEGACY_CLI_COMMAND_NAMES[0]}.exe"),
("UserDataDirDisplay", rf"%LOCALAPPDATA%\{branding.WINDOWS_USER_DATA_DIR_NAME}"),
+ ("AppPublisher", branding.LAUNCHER_ENTRY_NAME),
+ ("LegacyAppName", branding.LEGACY_LAUNCHER_ENTRY_NAMES[0]),
+ ("LegacyGuiExeName", branding.LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]),
],
)
def test_the_windows_installer_script_restates_the_names(definition: str, expected: str) -> None:
@@ -222,23 +336,46 @@ def test_the_windows_installer_script_restates_the_names(definition: str, expect
)
+def test_the_windows_installer_retires_the_earlier_shortcuts_and_keeps_its_identity() -> None:
+ script = _read("packaging/windows/PersonalJarvis.iss")
+ # Windows upgrades by AppId: a new one would install a second product.
+ assert '#define AppGuid "7F1C4E42-2E5B-4F0A-9E1B-1A7B6C0D5E88"' in script
+ # The shortcuts an earlier release created under the earlier name go; the
+ # Desktop one only where it starts this installation.
+ install_delete = script.split("\n[InstallDelete]\n", 1)[1].split("\n[", 1)[0]
+ assert r'"{autoprograms}\{#LegacyAppName}\{#LegacyAppName}.lnk"' in install_delete
+ assert "Check: LegacyShortcutStartsThisApp(" in install_delete
+ assert "UsePreviousGroup=no" in script
+ # The setup's product name is what the SignPath artifact configuration
+ # checks (docs/code-signing-policy.md): it stays until that pin moves.
+ assert "VersionInfoProductName={#SignedProductName}" in script
+ policy = _read("docs/code-signing-policy.md")
+ signed = re.search(r'#define SignedProductName "([^"]+)"', script)
+ assert signed is not None and f'product-name="{signed.group(1)}"' in policy
+
+
def test_the_packaging_scripts_restate_the_names() -> None:
windows = _read("packaging/windows/build.ps1")
frozen_cli_names = (branding.CLI_COMMAND_NAME, branding.LEGACY_CLI_COMMAND_NAMES[0])
required = (
branding.WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
+ *branding.LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
*(f"{name}.exe" for name in frozen_cli_names),
)
assert "@(" + ", ".join(f'"{name}"' for name in required) + ")" in windows
quoted = " ".join(f'"{name}"' for name in frozen_cli_names)
assert f"\nCLI_EXE_NAMES=({quoted})\n" in _read("packaging/linux/build.sh")
+ # The AppImage links its launcher to the windowed executable, current name first.
+ gui = (branding.MACOS_EXECUTABLE_NAME, *branding.LEGACY_MACOS_EXECUTABLE_NAMES)
+ quoted_gui = " ".join(f'"{name}"' for name in gui)
+ assert f'\nGUI_EXE_CANDIDATES=({quoted_gui} "Jarvis")\n' in _read("packaging/linux/build.sh")
assert f"for cli_name in {' '.join(frozen_cli_names)}; do" in _read(
"packaging/macos/build.sh"
)
- assert (
- f'\nDESKTOP_FILE_NAME="{branding.LINUX_DESKTOP_ENTRY_FILE_NAME}"\n'
- in _read("packaging/linux/build.sh")
- )
+ linux = _read("packaging/linux/build.sh")
+ assert f'\nDESKTOP_FILE_NAME="{branding.LINUX_DESKTOP_ENTRY_FILE_NAME}"\n' in linux
+ # The installed icon carries the window class's name, like the entry.
+ assert f'\nICON_FILE_NAME="{branding.LINUX_WM_CLASS}.png"\n' in linux
assert f'\nAPP_NAME="{branding.MACOS_APP_NAME}"\n' in _read("packaging/macos/build.sh")
@@ -264,6 +401,16 @@ def test_the_project_metadata_restates_the_distribution_and_its_commands() -> No
assert data_files, "the wheel ships its reader documents as data files"
for target in data_files:
assert target.startswith(f"share/{branding.DISTRIBUTION_NAME}/"), target
+ # The extras refer to the project by its own name, never by the earlier one.
+ for group in project["project"]["optional-dependencies"].values():
+ for legacy in branding.LEGACY_DISTRIBUTION_NAMES:
+ assert not any(item.startswith(f"{legacy}[") for item in group), group
+
+
+def test_the_frozen_build_bundles_the_metadata_under_either_distribution_name() -> None:
+ spec = _read("jarvis.spec")
+ assert f"\nDISTRIBUTION_NAMES = {branding.DISTRIBUTION_NAMES!r}\n" in spec
+ assert "datas += copy_metadata(_installed_distribution())" in spec
def test_the_frontend_restates_the_display_name_and_a_known_repository() -> None:
@@ -390,6 +537,8 @@ def test_the_frozen_hook_points_the_data_directory_inside_the_user_directory(
assert Path(os.environ[DATA_DIR_ENV_VAR]) == user_data_dir() / "data"
assert resolve_data_dir(tmp_path / "ignored") == user_data_dir() / "data"
assert Path(os.environ["JARVIS_CONFIG"]) == user_data_dir() / branding.CONFIG_FILE_NAME
+ # The package resolves the same file the hook pointed at.
+ assert core_config.resolve_config_file(user_data_dir()) == Path(os.environ["JARVIS_CONFIG"])
# ---------------------------------------------------------------------------
@@ -428,6 +577,12 @@ _ROLES: tuple[tuple[str, str, str], ...] = (
("applications-dir", "app", "MACOS_APP_DIR_NAME"),
("start-menu", "app", "WINDOWS_SHORTCUT_FILE_NAME"),
("desktop-entry", "app", "LINUX_DESKTOP_ENTRY_FILE_NAME"),
+ # The config file sits in the checkout root or in the per-user directory.
+ ("config-dir", "config", "CONFIG_FILE_NAME"),
+ # Both folders can land on the Desktop (deliverables fall back to it).
+ ("desktop-dir", "output-mirror", "DESKTOP_OUTPUT_MIRROR_DIR_NAME"),
+ ("desktop-dir", "deliverables", "DELIVERABLES_DIR_NAME"),
+ ("vault-dir", "wiki", "OBSIDIAN_VAULT_FOLDER_NAME"),
)
@@ -481,15 +636,16 @@ def _current_names() -> list[IdentityName]:
# yet. When they become the branding values, today's values become LEGACY_*
# and the first test below covers them without this table. The commands
# ``dodaios`` and ``dodaiosctl`` already made that move: they are console
-# scripts now, and the first test sees them among the current names.
+# scripts now, and the first test sees them among the current names. So did
+# the data directory and the config file, the install directory, the
+# Windows identity (the windowed executable, its per-user folder, the
+# shortcut), the Linux desktop entry and the macOS bundle's name: current names
+# now, with their earlier values in LEGACY_* tuples. The macOS bundle ids below
+# are planned only: a new id starts every privacy grant over, so they wait for
+# their own migration.
_PLANNED_NAMES: tuple[IdentityName, ...] = (
- IdentityName("executable", "gui-exe", "planned", "DodaiosApp"),
- IdentityName("home-dir", "install", "planned", ".dodaios"),
- IdentityName("home-dir", "data", "planned", ".dodaios-data"),
- IdentityName("localappdata-dir", "data", "planned", "Dodaios"),
IdentityName("macos-bundle-id", "managed", "planned", "com.dodaios.desktop"),
IdentityName("macos-bundle-id", "dmg", "planned", "ai.dodaios.desktop"),
- IdentityName("keyring-service", "app", "planned", "dodaios"),
)
@@ -506,29 +662,78 @@ def test_no_two_current_or_legacy_names_collide() -> None:
assert _collisions(names) == []
-def test_the_planned_launcher_name_stays_clear_of_the_commands_that_exist() -> None:
- # The planned windowed executable shares a folder with the console
- # scripts. The commands are real now, so this is the pair that would
- # collide if the launcher were ever named like the command.
- planned_gui = [name for name in _PLANNED_NAMES if name.role == "gui-exe"]
- assert planned_gui, "the planned launcher name left the table"
+def test_the_launcher_names_stay_clear_of_the_commands_that_exist() -> None:
+ # The windowed executable shares a folder with the console scripts, under
+ # its current name and its earlier one (the frozen build ships both).
+ gui = [name for name in _current_names() if name.role == "gui-exe"]
+ assert {(name.generation, name.value) for name in gui} >= {
+ ("current", "DodaiosApp"),
+ ("legacy", "PersonalJarvis"),
+ }
commands = {name.casefold() for name in _console_scripts()}
- for name in planned_gui:
+ for name in gui:
assert name.value.casefold() not in commands
# And the check has teeth: a launcher spelled like the command is caught.
clash = IdentityName("executable", "gui-exe", "planned", branding.CLI_COMMAND_NAME.title())
assert len(_collisions([*_current_names(), clash])) == 1
+def test_the_windows_identity_moved_with_its_earlier_names_in_the_table() -> None:
+ names = _current_names()
+ found = {(n.namespace, n.role, n.generation, n.value) for n in names}
+ assert ("localappdata-dir", "launcher", "current", "DodaiosApp") in found
+ assert ("localappdata-dir", "launcher", "legacy", "PersonalJarvis") in found
+ assert ("start-menu", "app", "current", "Dodaios.lnk") in found
+ assert ("start-menu", "app", "legacy", "Personal Jarvis.lnk") in found
+ # The launcher folder sits beside the data directory, so it cannot take
+ # the plain product name the data directory has.
+ data = next(n for n in names if n.role == "data" and n.namespace == "localappdata-dir")
+ clash = IdentityName("localappdata-dir", "launcher", "planned", data.value)
+ assert len(_collisions([*names, clash])) == 1
+
+
+def test_the_macos_bundle_name_moved_with_its_earlier_name_in_the_table() -> None:
+ names = _current_names()
+ bundle = {(n.generation, n.value) for n in names if n.namespace == "applications-dir"}
+ assert bundle == {("current", "Dodaios.app"), ("legacy", "Personal Jarvis.app")}
+
+
def test_the_planned_names_collide_with_nothing_an_installation_carries() -> None:
assert _collisions([*_current_names(), *_PLANNED_NAMES]) == []
+def test_the_data_directory_moved_with_its_earlier_names_in_the_table() -> None:
+ names = _current_names()
+ data = {(n.namespace, n.generation, n.value) for n in names if n.role == "data"}
+ assert ("localappdata-dir", "current", "Dodaios") in data
+ assert ("localappdata-dir", "legacy", "Jarvis") in data
+ assert ("home-dir", "current", ".dodaios-data") in data
+ assert ("home-dir", "legacy", ".jarvis") in data
+ config = {(n.generation, n.value) for n in names if n.role == "config"}
+ assert config == {("current", "dodaios.toml"), ("legacy", "jarvis.toml")}
+ # A launcher folder named like the data directory would be the same folder.
+ clash = IdentityName("localappdata-dir", "launcher", "planned", "dodaios")
+ assert len(_collisions([*names, clash])) == 1
+
+
+def test_the_install_directory_moved_with_its_earlier_name_in_the_table() -> None:
+ names = _current_names()
+ install = {(n.namespace, n.generation, n.value) for n in names if n.role == "install"}
+ assert install == {
+ ("home-dir", "current", ".dodaios"),
+ ("home-dir", "legacy", ".personal-jarvis"),
+ }
+ # The data directory's fallback sits in the same home directory and must
+ # never be spelled like the install directory, under either name.
+ clash = IdentityName("home-dir", "data", "planned", ".DODAIOS")
+ assert len(_collisions([*names, clash])) == 1
+
+
def test_legacy_constants_join_the_table_by_name() -> None:
module = ModuleType("branding_after_a_rename")
for _namespace, _role, constant in _ROLES:
setattr(module, constant, getattr(branding, constant))
- module.DEFAULT_INSTALL_DIR_NAME = ".dodaios"
+ module.DEFAULT_INSTALL_DIR_NAME = ".renamed-again"
module.LEGACY_DEFAULT_INSTALL_DIR_NAMES = (branding.DEFAULT_INSTALL_DIR_NAME,)
# A new data directory that only differs in case from the OLD install
# directory would be the same folder on Windows and macOS.
diff --git a/tests/unit/core/test_installer_update.py b/tests/unit/core/test_installer_update.py
index 4759ca18b8..613918c1f8 100644
--- a/tests/unit/core/test_installer_update.py
+++ b/tests/unit/core/test_installer_update.py
@@ -162,6 +162,13 @@ def test_the_updater_accepts_every_installer_the_release_pipeline_publishes() ->
assert release_assets.INSTALLERS == set().union(*release_assets.PLATFORM_INSTALLERS.values())
+def test_releases_publish_every_accepted_name_so_old_installs_keep_updating() -> None:
+ """An install frozen before the rename knows only the earlier name of its row."""
+ from scripts.ci import release_assets
+
+ assert set(release_assets.INSTALLER_NAME_PAIRS) == set(iu.INSTALLER_ASSET_NAMES.values())
+
+
def test_select_installer_asset_prefers_the_first_accepted_name() -> None:
assets = _release_assets(
"PersonalJarvis-macOS-arm64.dmg",
@@ -583,7 +590,8 @@ renames_bundles = pytest.mark.skipif(
[
"Personal Jarvis 2.app", # Finder's "Keep Both"
"Assistant.app", # renamed by hand
- "personal jarvis.app", # same name, other case
+ "dodaios.app", # same name, other case
+ "Dodaios 2.app", # "Keep Both" of the current name
],
)
def test_macos_handover_falls_back_to_the_only_bundle_on_the_volume(
@@ -619,6 +627,62 @@ def test_macos_handover_falls_back_to_the_only_bundle_on_the_volume(
)
+@renames_bundles
[email protected]("running_id", sorted(iu._OWN_MACOS_BUNDLE_IDS))
+def test_macos_handover_gives_a_bundle_under_an_earlier_name_the_current_one(
+ tmp_path: Path, running_id: str
+) -> None:
+ """The image carries the current name and the running bundle an earlier one
+ of ours: the update lands under the current name and the old bundle goes."""
+ dmg = tmp_path / "PersonalJarvis-macOS-arm64.dmg"
+ dmg.write_bytes(PAYLOAD)
+ earlier = iu.LEGACY_MACOS_APP_DIR_NAMES[0]
+ app = tmp_path / "Applications" / earlier
+ _write_bundle(app, "old", running_id)
+ current = app.with_name(iu.MACOS_APP_DIR_NAME)
+ runner = _mounting_runner(iu.MACOS_APP_DIR_NAME, "new", running_id)
+
+ message = apply_installer(
+ dmg, platform_name="darwin", runner=runner, app_path=app, wait_for_pid=31
+ )
+
+ assert _bundle_payload(current) == "new"
+ assert not app.exists()
+ assert sorted(p.name for p in app.parent.iterdir()) == [iu.MACOS_APP_DIR_NAME]
+ assert runner.spawned == [relaunch_after_exit_command(31, [MACOS_OPEN, "-n", str(current)])]
+ assert iu.MACOS_APP_DIR_NAME in message and earlier in message
+
+
+@renames_bundles
+def test_macos_handover_keeps_a_bundle_under_an_earlier_name_when_the_image_has_it_too(
+ tmp_path: Path,
+) -> None:
+ # An image that still carries the earlier name is updated in place: both
+ # names are this app's, and only a move to the CURRENT name is a rename.
+ dmg = tmp_path / "PersonalJarvis-macOS-arm64.dmg"
+ dmg.write_bytes(PAYLOAD)
+ earlier = iu.LEGACY_MACOS_APP_DIR_NAMES[0]
+ app = tmp_path / "Applications" / iu.MACOS_APP_DIR_NAME
+ _write_bundle(app, "old", iu.MACOS_DMG_BUNDLE_ID)
+ runner = _mounting_runner(earlier, "new", iu.MACOS_DMG_BUNDLE_ID)
+
+ apply_installer(dmg, platform_name="darwin", runner=runner, app_path=app, wait_for_pid=2)
+
+ assert _bundle_payload(app) == "new"
+ assert sorted(p.name for p in app.parent.iterdir()) == [iu.MACOS_APP_DIR_NAME]
+
+
+def test_the_updater_keeps_recognising_every_name_and_id_of_ours() -> None:
+ assert iu.MACOS_APP_DIR_NAME == "Dodaios.app"
+ assert "Personal Jarvis.app" in iu.LEGACY_MACOS_APP_DIR_NAMES
+ assert set(iu.MACOS_APP_DIR_NAMES) == {iu.MACOS_APP_DIR_NAME, *iu.LEGACY_MACOS_APP_DIR_NAMES}
+ # The ids did not move with the name: a bundle under either is ours.
+ assert iu._OWN_MACOS_BUNDLE_IDS == {
+ "com.personal-jarvis.desktop",
+ "ai.personaljarvis.desktop",
+ }
+
+
def _renamed_release(tmp_path: Path, *, running_id: str | None) -> tuple[Path, Path, Path]:
"""``(dmg, running app, where the renamed app belongs)``."""
dmg = tmp_path / "Dodaios-macOS-arm64.dmg"
diff --git a/tests/unit/core/test_instance.py b/tests/unit/core/test_instance.py
index 312c985d7c..353de5b4c6 100644
--- a/tests/unit/core/test_instance.py
+++ b/tests/unit/core/test_instance.py
@@ -12,6 +12,9 @@ import pytest
from dodaios.core import instance as inst
from dodaios.core.branding import (
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_MUTEX_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
PRODUCT_NAME,
WINDOWS_APP_USER_MODEL_ID,
WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
@@ -79,6 +82,11 @@ def test_default_identity_is_the_stable_branding() -> None:
assert d.windows_mutex_name == WINDOWS_MUTEX_NAME
assert d.windows_shortcut_file_name == WINDOWS_SHORTCUT_FILE_NAME
assert d.windows_branded_launcher_file_name == WINDOWS_BRANDED_LAUNCHER_FILE_NAME
+ assert d.legacy_windows_mutex_names == LEGACY_WINDOWS_MUTEX_NAMES
+ assert d.legacy_windows_shortcut_file_names == LEGACY_WINDOWS_SHORTCUT_FILE_NAMES
+ assert (
+ d.legacy_windows_branded_launcher_file_names == LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES
+ )
assert d.data_dir_name == "data"
assert d.port_offset == 0 and d.port(47821) == 47821
assert d.icon_file_name == inst.DEFAULT_ICON_FILE_NAME
@@ -95,9 +103,25 @@ def test_dev_identity_differs_on_every_colliding_surface() -> None:
# the display name.
assert d.persistent_name == "Personal Jarvis"
assert v.persistent_name == "Personal Jarvis Dev"
- assert v.windows_shortcut_file_name == "Personal Jarvis Dev.lnk"
- assert v.windows_branded_launcher_file_name == "PersonalJarvisDev.exe"
- assert v.linux_desktop_entry_file_name == "personal-jarvis-dev.desktop"
+ # The Windows names follow their own current branding values, and each
+ # keeps the name an earlier release registered the same instance under.
+ assert v.windows_launcher_entry_name == "Dodaios Dev"
+ assert v.windows_shortcut_file_name == "Dodaios Dev.lnk"
+ assert v.legacy_windows_shortcut_file_names == ("Personal Jarvis Dev.lnk",)
+ assert v.windows_branded_launcher_file_name == "DodaiosAppDev.exe"
+ assert v.legacy_windows_branded_launcher_file_names == ("PersonalJarvisDev.exe",)
+ assert v.windows_mutex_name == "Global" + chr(92) + "Dodaios_v1_dev"
+ assert v.legacy_windows_mutex_names == ("Global" + chr(92) + "PersonalJarvis_v1_dev",)
+ # The Linux names moved together (entry, menu name, window class); the
+ # entry an earlier release wrote for the same instance is still found.
+ assert d.linux_app_name == "Dodaios"
+ assert v.linux_app_name == "Dodaios Dev"
+ assert d.linux_desktop_entry_file_name == "dodaios.desktop"
+ assert v.linux_desktop_entry_file_name == "dodaios-dev.desktop"
+ assert d.legacy_linux_desktop_entry_file_names == ("personal-jarvis.desktop",)
+ assert v.legacy_linux_desktop_entry_file_names == ("personal-jarvis-dev.desktop",)
+ assert d.linux_wm_class == "dodaios"
+ assert v.linux_wm_class == "dodaios-dev"
for attr in (
"display_name",
"compact_name",
@@ -108,8 +132,10 @@ def test_dev_identity_differs_on_every_colliding_surface() -> None:
"windows_mutex_name",
"windows_shortcut_file_name",
"windows_branded_launcher_file_name",
+ "linux_app_name",
"linux_wm_class",
"linux_desktop_entry_file_name",
+ "legacy_linux_desktop_entry_file_names",
"macos_bundle_id",
"state_file_suffix",
):
diff --git a/tests/unit/core/test_keyring_service_rename.py b/tests/unit/core/test_keyring_service_rename.py
new file mode 100644
index 0000000000..f15c9fe2cd
--- /dev/null
+++ b/tests/unit/core/test_keyring_service_rename.py
@@ -0,0 +1,268 @@
+"""The credential service was renamed; no credential may be lost or come back.
+
+``get_secret`` reads the legacy service when the current one has nothing for a
+slot (many slot names exist only at runtime, so no copy can be complete),
+``delete_secret`` clears every service, and ``set_secret`` refreshes a legacy
+entry only where one already exists. A read never writes. Every store here is
+a fake: the process-wide ``keyring`` points at ``FakePlatformKeyring`` and the
+0600 file store lives under ``tmp_path``.
+"""
+
+from __future__ import annotations
+
+import sys
+from collections.abc import Iterator
+from pathlib import Path
+
+import keyring
+import pytest
+
+from dodaios.core import branding
+from dodaios.core import config as c
+from tests.fakes.fake_keychain_vault import (
+ FakePerItemKeychain,
+ FakeSecurityCli,
+ vault_payload,
+)
+from tests.fakes.fake_platform_keyring import FakePlatformKeyring
+
+CURRENT = c.KEYRING_SERVICE
+LEGACY = c.LEGACY_KEYRING_SERVICES[0]
+SLOT = "groq_api_key"
+ENV = "GROQ_API_KEY"
+
+
+def platform(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Iterator[FakePlatformKeyring]:
+ # Never the darwin branch: it would wrap the fake in the real security CLI.
+ monkeypatch.setattr(sys, "platform", "linux")
+ monkeypatch.delenv("JARVIS_DATA_DIR", raising=False)
+ monkeypatch.delenv(ENV, raising=False)
+ monkeypatch.setattr(c, "DATA_DIR", tmp_path)
+ monkeypatch.setattr(c, "PROJECT_ROOT", tmp_path) # no .env file
+ monkeypatch.setattr(c, "_KEYRING_BACKEND_READY", True)
+ monkeypatch.setattr(c, "_FILE_BACKEND_ACTIVE", False)
+ monkeypatch.setattr(c, "_PLATFORM_KEYRING_BACKEND", None)
+ original = keyring.get_keyring()
+ fake = FakePlatformKeyring()
+ keyring.set_keyring(fake)
+ try:
+ yield fake
+ finally:
+ keyring.set_keyring(original)
+
+
+def test_the_service_names_come_from_branding() -> None:
+ assert CURRENT == branding.KEYRING_SERVICE_NAME == "dodaios"
+ assert c.LEGACY_KEYRING_SERVICES == branding.LEGACY_KEYRING_SERVICE_NAMES
+ assert LEGACY == "personal-jarvis"
+
+
+# ---------------------------------------------------------------- reads
+
+
+def test_a_key_saved_before_the_rename_is_read(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, SLOT)] = "legacy-value"
+
+ assert c.get_secret(SLOT) == "legacy-value"
+
+
+def test_the_current_service_wins_over_the_legacy_one(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, SLOT)] = "old"
+ platform.entries[(CURRENT, SLOT)] = "new"
+
+ assert c.get_secret(SLOT) == "new"
+
+
+def test_a_legacy_keyring_value_still_beats_env(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ # Before the rename the OS keyring value beat ENV; the rename keeps that.
+ platform.entries[(LEGACY, SLOT)] = "from-keyring"
+ monkeypatch.setenv(ENV, "from-env")
+
+ assert c.get_secret(SLOT) == "from-keyring"
+
+
+def test_env_still_beats_a_legacy_file_value(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ c._FileCredStore().set(LEGACY, SLOT, "from-file")
+ monkeypatch.setenv(ENV, "from-env")
+ assert c.get_secret(SLOT) == "from-env"
+
+ monkeypatch.delenv(ENV)
+ assert c.get_secret(SLOT) == "from-file"
+
+
+def test_env_is_read_when_no_service_has_the_slot(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ monkeypatch.setenv(ENV, "from-env")
+ assert c.get_secret(SLOT) == "from-env"
+ monkeypatch.delenv(ENV)
+ assert c.get_secret(SLOT) is None
+
+
+def test_a_read_never_writes_any_service(platform: FakePlatformKeyring, tmp_path: Path) -> None:
+ platform.entries[(LEGACY, SLOT)] = "legacy-value"
+
+ for _ in range(3):
+ assert c.get_secret(SLOT) == "legacy-value"
+ assert c.get_secret("never_saved_slot") is None
+
+ assert platform.writes(LEGACY) == []
+ assert platform.writes(CURRENT) == []
+ assert not (tmp_path / "credentials.json").exists()
+
+
+def test_a_legacy_read_on_the_file_backend_also_reads_the_retained_platform_copy(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ # After a platform failure the process runs on the file store, and the
+ # platform store is retained beside it: a legacy entry there still counts.
+ platform.entries[(LEGACY, SLOT)] = "legacy-platform"
+ assert c._install_file_cred_backend("test: platform write failed")
+ assert c._PLATFORM_KEYRING_BACKEND is platform
+
+ assert c.get_secret(SLOT) == "legacy-platform"
+ assert platform.writes(LEGACY) == []
+
+
+def test_a_legacy_read_never_folds_a_per_item_entry_into_the_macos_vault(
+ platform: FakePlatformKeyring,
+) -> None:
+ from dodaios.core.keychain_bundle import VAULT_ACCOUNT, DarwinBundleKeyringBackend
+
+ inner = FakePerItemKeychain()
+ cli = FakeSecurityCli()
+ inner.values[(LEGACY, SLOT)] = "per-item-legacy" # from before the vault existed
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = vault_payload({"other_api_key": "x"})
+ keyring.set_keyring(DarwinBundleKeyringBackend(inner, cli=cli))
+
+ assert c.get_secret(SLOT) == "per-item-legacy"
+ assert c.get_secret("other_api_key") == "x"
+
+ # A normal wrapper read would have moved the item into the legacy vault
+ # and deleted it; the legacy service stays exactly as it was.
+ assert cli.writes(LEGACY) == []
+ assert inner.writes(LEGACY) == []
+ assert inner.values[(LEGACY, SLOT)] == "per-item-legacy"
+
+
+def test_a_malformed_legacy_vault_does_not_hide_the_current_one(
+ platform: FakePlatformKeyring,
+) -> None:
+ from dodaios.core.keychain_bundle import VAULT_ACCOUNT, DarwinBundleKeyringBackend
+
+ inner = FakePerItemKeychain()
+ cli = FakeSecurityCli()
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = "not a vault"
+ cli.items[(CURRENT, VAULT_ACCOUNT)] = vault_payload({"openai_api_key": "current"})
+ keyring.set_keyring(DarwinBundleKeyringBackend(inner, cli=cli))
+
+ assert c.get_secret(SLOT) is None # legacy vault unreadable: absent
+ assert c.get_secret("openai_api_key") == "current"
+ assert cli.items[(LEGACY, VAULT_ACCOUNT)] == "not a vault"
+
+
+# ---------------------------------------------------------------- deletes
+
+
+def test_delete_clears_every_service_and_nothing_comes_back(
+ platform: FakePlatformKeyring,
+) -> None:
+ platform.entries[(LEGACY, SLOT)] = "legacy"
+ platform.entries[(CURRENT, SLOT)] = "current"
+ store = c._FileCredStore()
+ store.set(LEGACY, SLOT, "legacy-file")
+ store.set(CURRENT, SLOT, "current-file")
+ before = c.secret_generation()
+
+ assert c.delete_secret(SLOT) is True
+
+ assert c.get_secret(SLOT) is None
+ assert (LEGACY, SLOT) not in platform.entries
+ assert (CURRENT, SLOT) not in platform.entries
+ assert store.get(LEGACY, SLOT) is None
+ assert store.get(CURRENT, SLOT) is None
+ assert c.secret_generation() == before + 1 # one change, announced once
+
+
+def test_delete_of_a_key_that_only_exists_under_the_legacy_name(
+ platform: FakePlatformKeyring,
+) -> None:
+ platform.entries[(LEGACY, SLOT)] = "legacy"
+
+ assert c.delete_secret(SLOT) is True
+ assert c.get_secret(SLOT) is None
+
+
+def test_delete_of_an_absent_key_is_still_a_success(platform: FakePlatformKeyring) -> None:
+ assert c.delete_secret("never_saved_slot") is True
+
+
+def test_delete_reports_a_legacy_entry_it_could_not_remove(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ platform.entries[(LEGACY, SLOT)] = "stuck"
+ real_delete = platform.delete_password
+
+ def refuse_legacy(service: str, username: str) -> None:
+ if service == LEGACY:
+ return # claims success, keeps the entry
+ real_delete(service, username)
+
+ monkeypatch.setattr(platform, "delete_password", refuse_legacy)
+
+ assert c.delete_secret(SLOT) is False
+
+
+# ---------------------------------------------------------------- writes
+
+
+def test_a_save_goes_to_the_current_service(platform: FakePlatformKeyring) -> None:
+ assert c.set_secret(SLOT, "fresh") is True
+
+ assert platform.entries[(CURRENT, SLOT)] == "fresh"
+ assert (LEGACY, SLOT) not in platform.entries # never created there
+ assert c.get_secret(SLOT) == "fresh"
+
+
+def test_a_save_refreshes_an_existing_legacy_entry(platform: FakePlatformKeyring) -> None:
+ # An install that goes back to a version reading only the legacy service
+ # must see the value saved last.
+ platform.entries[(LEGACY, SLOT)] = "stale"
+ store = c._FileCredStore()
+ store.set(LEGACY, SLOT, "stale-file")
+
+ assert c.set_secret(SLOT, "fresh") is True
+
+ assert platform.entries[(CURRENT, SLOT)] == "fresh"
+ assert platform.entries[(LEGACY, SLOT)] == "fresh"
+ assert store.get(LEGACY, SLOT) == "fresh"
+
+
+def test_a_save_creates_no_legacy_file_entry(platform: FakePlatformKeyring) -> None:
+ platform.entries[(LEGACY, SLOT)] = "stale"
+
+ assert c.set_secret(SLOT, "fresh") is True
+
+ assert c._FileCredStore().get(LEGACY, SLOT) is None
+
+
+def test_a_failed_legacy_refresh_never_fails_the_save(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ platform.entries[(LEGACY, SLOT)] = "stale"
+ real_set = platform.set_password
+
+ def refuse_legacy(service: str, username: str, password: str) -> None:
+ if service == LEGACY:
+ raise RuntimeError("legacy write refused")
+ real_set(service, username, password)
+
+ monkeypatch.setattr(platform, "set_password", refuse_legacy)
+
+ assert c.set_secret(SLOT, "fresh") is True
+ assert c.get_secret(SLOT) == "fresh"
diff --git a/tests/unit/core/test_secret_slots_coverage.py b/tests/unit/core/test_secret_slots_coverage.py
new file mode 100644
index 0000000000..2692ef708f
--- /dev/null
+++ b/tests/unit/core/test_secret_slots_coverage.py
@@ -0,0 +1,216 @@
+"""Every credential the package saves has a name ``dodaios.core.secret_slots`` knows.
+
+The one-time copy to the renamed credential service and the uninstaller can
+only visit names they can list. This file reads every ``set_secret(...)`` and
+``set_password(...)`` call in ``dodaios/``: a key spelled as a literal or a
+module constant must be in ``KNOWN_SECRET_KEYS``, and a key computed at
+runtime must come from a module listed in ``DYNAMIC_SLOT_SOURCES``. A new
+credential slot therefore cannot ship without saying how it is found again.
+"""
+
+from __future__ import annotations
+
+import ast
+import functools
+import importlib.util
+import warnings
+from dataclasses import dataclass
+from pathlib import Path
+
+import pytest
+
+from dodaios.core.secret_slots import DYNAMIC_SLOT_SOURCES, KNOWN_SECRET_KEYS
+
+_ROOT = Path(__file__).resolve().parents[3]
+_PACKAGE = _ROOT / "dodaios"
+
+# Modules that implement a credential store: they receive the key as a
+# parameter from the callers checked below, or keep a store of their own.
+_STORE_IMPLEMENTATIONS = {
+ "dodaios.core.config": "set_secret itself and the backend probe",
+ "dodaios.core.keychain_bundle": "the macOS vault wrapper",
+ "dodaios.core.identity_migration": "the copy engine, keys come from secret_slots",
+ "dodaios.core.identity_credentials": "runs the copy over secret_slots' names",
+ "dodaios.board.sync": "its own service (jarvis-board), outside the renamed one",
+}
+
+
+@dataclass(frozen=True)
+class SecretWrite:
+ module: str
+ line: int
+ # The literal name, or None when it is computed at runtime.
+ name: str | None
+ expression: str
+
+
+def _module_name(path: Path) -> str:
+ return ".".join(path.relative_to(_ROOT).with_suffix("").parts)
+
+
+def _top_level_strings(tree: ast.Module) -> dict[str, str]:
+ found: dict[str, str] = {}
+ for node in tree.body:
+ targets: list[ast.expr] = []
+ if isinstance(node, ast.Assign):
+ targets = list(node.targets)
+ elif isinstance(node, ast.AnnAssign) and node.value is not None:
+ targets = [node.target]
+ value = getattr(node, "value", None)
+ if isinstance(value, ast.Constant) and isinstance(value.value, str):
+ for target in targets:
+ if isinstance(target, ast.Name):
+ found[target.id] = value.value
+ return found
+
+
+def _imported_names(tree: ast.AST, module: str) -> dict[str, tuple[str, str]]:
+ """``local name -> (module, name)`` for every ``from x import y`` in the file."""
+ found: dict[str, tuple[str, str]] = {}
+ for node in ast.walk(tree):
+ if not isinstance(node, ast.ImportFrom):
+ continue
+ origin = node.module or ""
+ if node.level:
+ package = module.split(".")[: -node.level]
+ origin = ".".join([*package, origin] if origin else package)
+ for alias in node.names:
+ found[alias.asname or alias.name] = (origin, alias.name)
+ return found
+
+
+def _parse(source: str) -> ast.Module:
+ with warnings.catch_warnings():
+ # A stray escape in some docstring is not this test's business.
+ warnings.simplefilter("ignore", DeprecationWarning)
+ warnings.simplefilter("ignore", SyntaxWarning)
+ return ast.parse(source)
+
+
+def _module_strings(module: str) -> dict[str, str]:
+ path = _ROOT.joinpath(*module.split(".")).with_suffix(".py")
+ if not path.is_file():
+ path = _ROOT.joinpath(*module.split("."), "__init__.py")
+ if not path.is_file():
+ return {}
+ return _top_level_strings(_parse(path.read_text(encoding="utf-8-sig")))
+
+
+def _callee(node: ast.expr) -> str | None:
+ if isinstance(node, ast.Name):
+ return node.id
+ if isinstance(node, ast.Attribute):
+ return node.attr
+ return None
+
+
+def _key_argument(call: ast.Call) -> ast.expr | None:
+ """The key a credential write names, if this call is one."""
+ callee = _callee(call.func)
+ if callee == "set_secret" and call.args:
+ return call.args[0]
+ if callee == "set_password" and len(call.args) >= 2:
+ return call.args[1]
+ # ``asyncio.to_thread(set_secret, key, value)`` and the like.
+ for index, argument in enumerate(call.args[:-1]):
+ if _callee(argument) == "set_secret":
+ return call.args[index + 1]
+ return None
+
+
+def secret_writes(source: str, module: str) -> list[SecretWrite]:
+ tree = _parse(source)
+ constants = _top_level_strings(tree)
+ imports = _imported_names(tree, module)
+ writes: list[SecretWrite] = []
+ for node in ast.walk(tree):
+ if not isinstance(node, ast.Call):
+ continue
+ key = _key_argument(node)
+ if key is None:
+ continue
+ name: str | None = None
+ if isinstance(key, ast.Constant) and isinstance(key.value, str):
+ name = key.value
+ elif isinstance(key, ast.Name) and key.id in constants:
+ name = constants[key.id]
+ elif isinstance(key, ast.Name) and key.id in imports:
+ origin, original = imports[key.id]
+ name = _module_strings(origin).get(original)
+ writes.append(SecretWrite(module, node.lineno, name, ast.unparse(key)))
+ return writes
+
+
+def _shipped_modules() -> tuple[tuple[str, str], ...]:
+ files = [
+ path
+ for path in _PACKAGE.rglob("*.py")
+ if "node_modules" not in path.parts and "frontend" not in path.parts
+ ]
+ return tuple((_module_name(path), path.read_text(encoding="utf-8-sig")) for path in files)
+
+
+def _all_writes() -> list[SecretWrite]:
+ writes: list[SecretWrite] = []
+ for module, source in _shipped_modules():
+ if module in _STORE_IMPLEMENTATIONS:
+ continue
+ writes.extend(secret_writes(source, module))
+ return writes
+
+
+def _offenders(writes: list[SecretWrite]) -> list[str]:
+ offenders: list[str] = []
+ for write in writes:
+ if write.name is not None:
+ if write.name not in KNOWN_SECRET_KEYS:
+ offenders.append(
+ f"{write.module}:{write.line}: {write.name!r} is not in KNOWN_SECRET_KEYS"
+ )
+ elif write.module not in DYNAMIC_SLOT_SOURCES:
+ offenders.append(
+ f"{write.module}:{write.line}: computed key {write.expression!r}, "
+ "but the module is not in DYNAMIC_SLOT_SOURCES"
+ )
+ return offenders
+
+
+def test_every_saved_credential_name_can_be_found_again() -> None:
+ writes = _all_writes()
+ # The scan sees the package: fixed names and computed ones alike.
+ assert len([w for w in writes if w.name is not None]) >= 6
+ assert len([w for w in writes if w.name is None]) >= 10
+ assert _offenders(writes) == [], (
+ "list the name in dodaios/core/secret_slots.py:\n" + "\n".join(_offenders(writes))
+ )
+
+
+def test_every_fixed_name_is_still_saved_or_read_somewhere() -> None:
+ # A name nothing spells any more is dead weight in the copy and the
+ # uninstaller; it should leave the table with its last user.
+ sources = "\n".join(source for _module, source in _shipped_modules())
+ for name in KNOWN_SECRET_KEYS:
+ assert f'"{name}"' in sources, name
+
+
[email protected]("module", sorted(DYNAMIC_SLOT_SOURCES))
+def test_every_dynamic_source_is_a_real_module(module: str) -> None:
+ assert importlib.util.find_spec(module) is not None, module
+
+
+ ("source", "expected"),
+ [
+ ('set_secret("brand_new_slot", value)\n', ["'brand_new_slot' is not in KNOWN"]),
+ ('SLOT = "brand_new_slot"\nset_secret(SLOT, value)\n', ["'brand_new_slot' is not in"]),
+ ('keyring.set_password(SERVICE, f"x_{item}", value)\n', ["computed key"]),
+ ("asyncio.to_thread(set_secret, make_slot(row), value)\n", ["computed key"]),
+ ('set_secret("telegram_bot_token", value)\n', []),
+ ],
+)
+def test_the_scan_has_teeth(source: str, expected: list[str]) -> None:
+ found = _offenders(secret_writes(source, "dodaios.some_new_module"))
+ assert len(found) == len(expected)
+ for message, fragment in zip(found, expected, strict=True):
+ assert fragment in message
diff --git a/tests/unit/core/test_update_contract.py b/tests/unit/core/test_update_contract.py
index 3628ed4540..6b4c3a0b04 100644
--- a/tests/unit/core/test_update_contract.py
+++ b/tests/unit/core/test_update_contract.py
@@ -18,7 +18,12 @@ from pathlib import Path
import pytest
import dodaios
-from dodaios.core.branding import CONFIG_FILE_NAME, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID
+from dodaios.core.branding import (
+ CONFIG_FILE_NAME,
+ LEGACY_CONFIG_FILE_NAMES,
+ MACOS_APP_DIR_NAME,
+ MACOS_BUNDLE_ID,
+)
from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
from dodaios.core.update_contract import (
CONTRACT_PATH,
@@ -41,12 +46,36 @@ def _document(**overrides: object) -> str:
# The tracked contract describes this tree
# --------------------------------------------------------------------------- #
def test_the_tracked_contract_is_the_default_contract() -> None:
- """A release without the file must behave exactly like this one."""
+ """A release without the file must behave exactly like this one.
+
+ Except for the rollback hook: it belongs to the release that ships it, and
+ a tree that states none has nothing to undo.
+ """
payload = json.loads((REPO / CONTRACT_PATH).read_text(encoding="utf-8"))
assert payload.pop("schema") == CONTRACT_SCHEMA
- stated = {key: value for key, value in asdict(DEFAULT_CONTRACT).items() if value is not None}
+ hook = payload.pop("rollback_hook")
+ stated = {
+ key: list(value) if isinstance(value, tuple) else value
+ for key, value in asdict(DEFAULT_CONTRACT).items()
+ if value is not None
+ }
assert payload == stated
- assert read_update_contract(REPO) == DEFAULT_CONTRACT
+ assert read_update_contract(REPO) == replace(DEFAULT_CONTRACT, rollback_hook=hook)
+
+
+def test_the_rollback_hook_is_a_file_this_tree_tracks() -> None:
+ # The updater runs only a tracked file; a hook it skips undoes nothing.
+ hook = read_update_contract(REPO).rollback_hook
+ assert hook is not None
+ assert (REPO / hook).is_file()
+ tracked = subprocess.run(
+ ["git", "ls-files", "--error-unmatch", "--", hook],
+ cwd=REPO,
+ capture_output=True,
+ check=False,
+ creationflags=NO_WINDOW_CREATIONFLAGS,
+ )
+ assert tracked.returncode == 0, f"{hook} is not tracked"
def test_the_contract_points_at_files_this_tree_really_has() -> None:
@@ -75,11 +104,14 @@ def test_a_package_move_publishes_a_contract_this_reader_follows() -> None:
published = codemod.Rewriter(package, moved, layout).transform(CONTRACT_PATH, shipped)
+ hook = read_update_contract(REPO).rollback_hook
+ assert hook is not None and hook.startswith(f"{package}/")
assert parse_update_contract(published.decode("utf-8")) == replace(
read_update_contract(REPO),
ui_bundle_dir=f"{moved}/ui/web/dist",
launcher_module=f"{moved}.ui.web.launcher",
version_file=f"{moved}/__init__.py",
+ rollback_hook=f"{moved}/{hook.removeprefix(f'{package}/')}",
)
@@ -87,7 +119,10 @@ def test_the_contract_agrees_with_every_other_copy_of_these_names() -> None:
from dodaios.autostart.command import LAUNCHER_MODULE as autostart_launcher
from dodaios.ui import relauncher
- assert DEFAULT_CONTRACT.config_file == CONFIG_FILE_NAME
+ # Legacy name first: an existing jarvis.toml stays the configuration, and
+ # an updater from before ``config_files`` reads the one name it knows.
+ assert DEFAULT_CONTRACT.config_files == (*LEGACY_CONFIG_FILE_NAMES, CONFIG_FILE_NAME)
+ assert DEFAULT_CONTRACT.config_file == LEGACY_CONFIG_FILE_NAMES[0]
assert DEFAULT_CONTRACT.macos_app_dir_name == MACOS_APP_DIR_NAME
assert DEFAULT_CONTRACT.macos_bundle_id == MACOS_BUNDLE_ID
assert DEFAULT_CONTRACT.launcher_module == autostart_launcher
@@ -143,6 +178,7 @@ def test_a_moved_tree_is_read_as_it_describes_itself(tmp_path: Path) -> None:
launcher_module="newpkg.ui.web.launcher",
version_file="newpkg/__init__.py",
config_file="newpkg.toml",
+ config_files=("newpkg.toml",),
macos_app_dir_name="New Product.app",
macos_bundle_id="com.new-product.desktop",
rollback_hook="install/rollback.py",
@@ -311,6 +347,24 @@ def test_a_file_that_is_not_utf8_is_not_a_contract(tmp_path: Path) -> None:
# released with, so these must keep parsing to these values: tightening a rule
# here silently turns a published contract into "use the defaults", which for a
# release that moved its files means every update rolls back.
+# The contract this tree ships: the earlier single name for the updaters that
+# read only ``config_file``, and every name for the ones that read the list.
+# The macOS bundle has its current name (the installer renames it in place,
+# under the bundle id it always had), and a failed update gives it back the
+# name the revision it falls back to knows.
+SHIPPED_DOCUMENT = """{
+ "schema": 1,
+ "ui_bundle_dir": "dodaios/ui/web/dist",
+ "launcher_module": "dodaios.ui.web.launcher",
+ "version_file": "dodaios/__init__.py",
+ "config_file": "jarvis.toml",
+ "config_files": ["jarvis.toml", "dodaios.toml"],
+ "macos_app_dir_name": "Dodaios.app",
+ "macos_bundle_id": "com.personal-jarvis.desktop",
+ "rollback_hook": "dodaios/setup/update_rollback.py"
+}
+"""
+
SCHEMA_1_GOLDEN = [
(
"""{
@@ -328,11 +382,25 @@ SCHEMA_1_GOLDEN = [
launcher_module="dodaios.ui.web.launcher",
version_file="dodaios/__init__.py",
config_file="jarvis.toml",
+ config_files=("jarvis.toml",),
macos_app_dir_name="Personal Jarvis.app",
macos_bundle_id="com.personal-jarvis.desktop",
rollback_hook=None,
),
),
+ (
+ SHIPPED_DOCUMENT,
+ UpdateContract(
+ ui_bundle_dir="dodaios/ui/web/dist",
+ launcher_module="dodaios.ui.web.launcher",
+ version_file="dodaios/__init__.py",
+ config_file="jarvis.toml",
+ config_files=("jarvis.toml", "dodaios.toml"),
+ macos_app_dir_name="Dodaios.app",
+ macos_bundle_id="com.personal-jarvis.desktop",
+ rollback_hook="dodaios/setup/update_rollback.py",
+ ),
+ ),
(
'{"schema": 1, "ui_bundle_dir": "dodaios/ui/web/dist",'
' "launcher_module": "dodaios.ui.web.launcher",'
@@ -344,6 +412,7 @@ SCHEMA_1_GOLDEN = [
launcher_module="dodaios.ui.web.launcher",
version_file="dodaios/__init__.py",
config_file="dodaios.toml",
+ config_files=("dodaios.toml",),
macos_app_dir_name="Dodaios.app",
macos_bundle_id="ai.dodaios.desktop",
rollback_hook="install/rollback_hook.py",
@@ -366,6 +435,7 @@ SCHEMA_1_GOLDEN = [
launcher_module="_app2.ui.web.launcher_v2",
version_file="src/app_2/_version.py",
config_file=".app-2.toml",
+ config_files=(".app-2.toml",),
macos_app_dir_name="App 2 beta-x.app",
macos_bundle_id="io.app-2.Desktop",
rollback_hook=None,
@@ -384,4 +454,26 @@ def test_schema_1_documents_keep_their_meaning(
def test_the_shipped_contract_is_the_first_golden_document() -> None:
"""Byte for byte: what an installed copy of the previous version will read."""
shipped = (REPO / CONTRACT_PATH).read_bytes().replace(b"\r\n", b"\n")
- assert shipped.decode("utf-8") == SCHEMA_1_GOLDEN[0][0]
+ assert shipped.decode("utf-8") == SHIPPED_DOCUMENT
+ # The single name an older updater reads is a file such an install has.
+ assert json.loads(SHIPPED_DOCUMENT)["config_file"] == LEGACY_CONFIG_FILE_NAMES[0]
+
+
+def test_a_document_that_names_one_config_file_means_only_that_one() -> None:
+ contract = parse_update_contract(_document(config_file="x.toml"))
+ assert contract.config_files == ("x.toml",)
+
+
+def test_the_config_file_list_is_read_in_order() -> None:
+ contract = parse_update_contract(_document(config_files=["b.toml", "a.toml"]))
+ assert contract.config_files == ("b.toml", "a.toml")
+ # A list stated without the single name keeps that name's default.
+ assert contract.config_file == DEFAULT_CONTRACT.config_file
+
+
+ "bad",
+ [[], "jarvis.toml", ["../jarvis.toml"], ["a.toml", "a.toml"], [1], ["a.toml"] * 9],
+)
+def test_an_invalid_config_file_list_rejects_the_document(bad: object) -> None:
+ assert parse_update_contract(_document(config_files=bad)) == DEFAULT_CONTRACT
diff --git a/tests/unit/install/test_branding_contract.py b/tests/unit/install/test_branding_contract.py
index a492cc950e..3252325d3d 100644
--- a/tests/unit/install/test_branding_contract.py
+++ b/tests/unit/install/test_branding_contract.py
@@ -12,6 +12,9 @@ from dodaios.core.branding import (
DEFAULT_INSTALL_DIR_NAME,
DEFAULT_OFFICIAL_REPO_SLUG,
KEYRING_SERVICE_NAME,
+ LEGACY_CONFIG_FILE_NAMES,
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
LINUX_DESKTOP_ENTRY_FILE_NAME,
MACOS_APP_DIR_NAME,
MACOS_AUTOSTART_LABEL,
@@ -75,6 +78,12 @@ def test_verifier_identity_regexes_are_derived_from_resolved_slug() -> None:
("relative_path", "variable", "quote", "expected"),
[
("install/install.sh", "CONFIG_FILE_NAME", '"', CONFIG_FILE_NAME),
+ (
+ "install/install.sh",
+ "LEGACY_CONFIG_FILE_NAME",
+ '"',
+ LEGACY_CONFIG_FILE_NAMES[0],
+ ),
(
"install/install.sh",
"MACOS_AUTOSTART_LABEL",
@@ -82,6 +91,7 @@ def test_verifier_identity_regexes_are_derived_from_resolved_slug() -> None:
MACOS_AUTOSTART_LABEL,
),
("install/install.ps1", "$ConfigFileName", "'", CONFIG_FILE_NAME),
+ ("install/install.ps1", "$LegacyConfigFileName", "'", LEGACY_CONFIG_FILE_NAMES[0]),
(
"install/uninstall.sh",
"DEFAULT_INSTALL_DIR_NAME",
@@ -144,3 +154,15 @@ def test_standalone_identity_projection_matches_canonical_value(
assignment = f"{variable} = {quote}{expected}{quote}"
compact_assignment = f"{variable}={quote}{expected}{quote}"
assert assignment in source or compact_assignment in source
+
+
+def test_the_windows_uninstaller_names_every_earlier_shortcut() -> None:
+ source = (_ROOT / "install/uninstall.ps1").read_text(encoding="utf-8")
+ quoted = ", ".join(f"'{name}'" for name in LEGACY_WINDOWS_SHORTCUT_FILE_NAMES)
+ assert f"$LegacyWindowsShortcutFileNames = @({quoted})" in source
+
+
+def test_the_shell_uninstaller_names_every_earlier_linux_entry() -> None:
+ source = (_ROOT / "install/uninstall.sh").read_text(encoding="utf-8")
+ names = " ".join(LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES)
+ assert f'LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES="{names}"' in source
diff --git a/tests/unit/install/test_install_dir_move.py b/tests/unit/install/test_install_dir_move.py
new file mode 100644
index 0000000000..c775f97cb8
--- /dev/null
+++ b/tests/unit/install/test_install_dir_move.py
@@ -0,0 +1,696 @@
+"""The shell installers move an install from ``~/.personal-jarvis`` to ``~/.dodaios``.
+
+Which folder an install run uses, and the one-time move on an update run, are
+run for real here: the blocks extracted from ``install/install.sh`` and the
+functions extracted from ``install/install.ps1`` and the two uninstallers, in a
+real shell, against a real git checkout, a real Python running the migration
+engine from the fetched commit, and real directory links (a junction on
+Windows, a symlink elsewhere). The order of the steps is pinned from the
+scripts' own text.
+"""
+
+from __future__ import annotations
+
+import os
+import re
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+
+import pytest
+
+from dodaios.core import branding
+from dodaios.core.identity_migration import create_directory_link, is_directory_link
+from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
+
+REPO = Path(__file__).resolve().parents[3]
+INSTALL_SH = REPO / "install" / "install.sh"
+INSTALL_PS1 = REPO / "install" / "install.ps1"
+UNINSTALL_SH = REPO / "install" / "uninstall.sh"
+UNINSTALL_PS1 = REPO / "install" / "uninstall.ps1"
+ENGINE = REPO / "dodaios" / "core" / "identity_migration.py"
+ENGINE_PATH = "dodaios/core/identity_migration.py"
+
+CURRENT = branding.DEFAULT_INSTALL_DIR_NAME
+LEGACY = branding.LEGACY_DEFAULT_INSTALL_DIR_NAMES[0]
+OVERRIDES = ("JARVIS_INSTALL_DIR", "DODAIOS_INSTALL_DIR")
+
+GIT = shutil.which("git")
+
+
+def _find_bash() -> str | None:
+ 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")
+ # On Windows the first ``bash`` on PATH can be the WSL launcher stub.
+ if bash and not any(part in bash.lower() for part in ("windowsapps", "system32")):
+ return bash
+ return None
+
+
+BASH = _find_bash()
+POWERSHELL = shutil.which("pwsh") or shutil.which("powershell")
+
+needs_git = pytest.mark.skipif(GIT is None, reason="git is not installed")
+needs_bash = pytest.mark.skipif(BASH is None, reason="no usable bash on this host")
+needs_powershell = pytest.mark.skipif(POWERSHELL is None, reason="no PowerShell on this host")
+
+
+def _sh_path(path: Path) -> str:
+ return str(path).replace("\\", "/")
+
+
+def _native(path: str | Path) -> str:
+ """A path as this OS spells it; Git Bash reports ``C:`` as ``/c``."""
+ text = str(path)
+ match = re.fullmatch(r"/([a-zA-Z])(/.*)?", text)
+ if sys.platform == "win32" and match:
+ text = f"{match.group(1)}:{match.group(2) or '/'}"
+ return text
+
+
+def _same(a: str | Path, b: str | Path) -> bool:
+ return os.path.normcase(os.path.abspath(_native(a))) == os.path.normcase(
+ os.path.abspath(_native(b))
+ )
+
+
+def _run(args: list[str], env: dict[str, str]) -> subprocess.CompletedProcess[str]:
+ return subprocess.run( # noqa: S603 - test-controlled command
+ args,
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ timeout=180,
+ env=env,
+ creationflags=NO_WINDOW_CREATIONFLAGS,
+ )
+
+
+def _base_env() -> dict[str, str]:
+ return {key: value for key, value in os.environ.items() if key not in OVERRIDES}
+
+
+def _block(source: Path, name: str) -> str:
+ text = source.read_text(encoding="utf-8")
+ begin = f"# --- {name} begin"
+ end = f"# --- {name} end"
+ assert begin in text and end in text, f"the {name} markers vanished from {source.name}"
+ body = text.split(begin, 1)[1].split(end, 1)[0]
+ # The marker line's own tail (the "(extracted by ...)" note) is not code.
+ return body.split("\n", 1)[1]
+
+
+def _ps_function(source: Path, name: str) -> str:
+ match = re.search(
+ rf"^function {re.escape(name)} *(\([^)]*\))? *\{{\r?\n.*?^\}}\r?$",
+ source.read_text(encoding="utf-8"),
+ re.S | re.M,
+ )
+ assert match is not None, f"{name} vanished from {source.name}"
+ return match.group(0)
+
+
+def _values(output: str) -> dict[str, str]:
+ found: dict[str, str] = {}
+ for line in output.splitlines():
+ if line.startswith("VALUE|"):
+ _tag, key, value = line.split("|", 2)
+ found[key] = value
+ return found
+
+
+def _run_powershell(script: Path, env: dict[str, str]) -> subprocess.CompletedProcess[str]:
+ assert POWERSHELL is not None
+ return _run(
+ [POWERSHELL, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File",
+ str(script)],
+ env,
+ )
+
+
+# --------------------------------------------------------------------------- #
+# Order and shape, read from the scripts #
+# --------------------------------------------------------------------------- #
+def test_sh_moves_the_folder_after_the_stop_and_before_the_checkout() -> None:
+ source = INSTALL_SH.read_text(encoding="utf-8")
+ update = source.split('if [ -d "$INSTALL_DIR/.git" ]; then\n', 1)[1]
+ update = update.split('\nelif [ -e "$INSTALL_DIR" ]; then\n', 1)[0]
+ stop = update.index("&& stop_running_app")
+ move = update.index("&& migrate_install_dir")
+ assert update.index(" fetch ") < stop < move < update.index(" checkout ")
+ assert move < update.index("reset --quiet --hard")
+ assert update.count("migrate_install_dir") == 1
+
+
+def test_ps1_moves_the_folder_after_the_stop_and_before_the_checkout() -> None:
+ source = INSTALL_PS1.read_text(encoding="utf-8")
+ update = source.split("if (Test-Path (Join-Path $InstallDir '.git')) {\n", 1)[1]
+ attempt = update.split("\n } finally {\n", 1)[0]
+ stop = attempt.index("Stop-RunningApp")
+ move = attempt.index("Invoke-InstallDirMigration")
+ # The git commands that follow run in the folder the move reports.
+ relocate = attempt.index("Set-Location -LiteralPath $InstallDir")
+ assert stop < move < relocate < attempt.index(" checkout ")
+ assert attempt.count("Invoke-InstallDirMigration") == 1
+
+
+def test_sh_runs_the_fetched_engine_isolated_from_the_home_directory() -> None:
+ block = _block(INSTALL_SH, "migrate-install-dir")
+ assert 'git -C "$INSTALL_DIR" show "origin/$BRANCH:$IDENTITY_ENGINE_PATH"' in block
+ assert 'mktemp "${TMPDIR:-/tmp}/' in block
+ assert '(cd "$HOME" && "$PYTHON_EXE" -I -B "$_mig_engine" migrate' in block
+ assert '"$LEGACY_INSTALL_DIR" "$CURRENT_INSTALL_DIR"' in block
+ assert 'rm -f "$_mig_engine"' in block
+
+
+def test_ps1_writes_the_engine_byte_for_byte_and_runs_it_isolated() -> None:
+ function = _ps_function(INSTALL_PS1, "Invoke-InstallDirMigration")
+ # Raw bytes from git's stdout to the file: no PowerShell pipeline, which
+ # would decode and re-encode the program text.
+ assert "RedirectStandardOutput = $true" in function
+ assert "StandardOutput.BaseStream.CopyTo($Bytes)" in function
+ assert "[IO.File]::WriteAllBytes($Engine, $Bytes.ToArray())" in function
+ for re_encoding in ("Out-File", "Set-Content", "Add-Content", " > "):
+ assert re_encoding not in function, re_encoding
+ assert "'show \"origin/' + $Branch + ':' + $IdentityEnginePath + '\"'" in function
+ assert "& $pythonExe -I -B $Engine migrate $LegacyInstallDir $CurrentInstallDir" in function
+ assert "[Environment]::CurrentDirectory = $env:USERPROFILE" in function
+ assert "Remove-Item -LiteralPath $Engine" in function
+
+
+def test_the_engine_source_is_ascii_so_no_code_page_can_alter_it() -> None:
+ ENGINE.read_bytes().decode("ascii")
+
+
[email protected]("source", [INSTALL_SH, INSTALL_PS1])
+def test_the_archive_download_tries_the_current_name_first(source: Path) -> None:
+ text = source.read_text(encoding="utf-8")
+ current = text.index("dodaios-src.tar.gz")
+ legacy = text.index("personal-jarvis-src.tar.gz")
+ assert current < legacy
+ # Both on one line: one list, tried in order.
+ assert text.count("dodaios-src.tar.gz") == 1
+ assert text.count("personal-jarvis-src.tar.gz") == 1
+ assert text[current:legacy].count("\n") == 0
+
+
+# --------------------------------------------------------------------------- #
+# Which folder a run uses #
+# --------------------------------------------------------------------------- #
+def _home(tmp_path: Path, legacy_state: str) -> Path:
+ home = tmp_path / "home"
+ home.mkdir()
+ if legacy_state == "real":
+ (home / LEGACY).mkdir()
+ elif legacy_state == "link":
+ (home / CURRENT).mkdir()
+ create_directory_link(home / LEGACY, home / CURRENT)
+ return home
+
+
+SH_CHOICE_DRIVER = """#!/usr/bin/env bash
+set -euo pipefail
+source "$BLOCK_FILE"
+printf 'VALUE|dir|%s\\n' "$INSTALL_DIR"
+printf 'VALUE|migrate|%s\\n' "$MIGRATE_LEGACY_INSTALL_DIR"
+"""
+
+CHOICE_CASES = [
+ # (legacy state, explicit dir, expected name or "explicit", migrate)
+ ("absent", None, CURRENT, "0"),
+ ("real", None, LEGACY, "1"),
+ ("link", None, CURRENT, "0"),
+ ("real", "explicit", "explicit", "0"),
+]
+
+
+@needs_bash
[email protected](("legacy_state", "explicit", "expected", "migrate"), CHOICE_CASES)
+def test_sh_picks_the_earlier_folder_only_while_it_is_a_real_directory(
+ tmp_path: Path, legacy_state: str, explicit: str | None, expected: str, migrate: str
+) -> None:
+ home = _home(tmp_path, legacy_state)
+ block = tmp_path / "block.sh"
+ block.write_text(_block(INSTALL_SH, "install-dir-choice"), encoding="utf-8", newline="\n")
+ driver = tmp_path / "driver.sh"
+ driver.write_text(SH_CHOICE_DRIVER, encoding="utf-8", newline="\n")
+ env = {**_base_env(), "HOME": _sh_path(home), "BLOCK_FILE": _sh_path(block)}
+ if explicit:
+ env["JARVIS_INSTALL_DIR"] = _sh_path(tmp_path / explicit)
+
+ result = _run([str(BASH), str(driver)], env)
+
+ assert result.returncode == 0, result.stderr
+ values = _values(result.stdout)
+ wanted = tmp_path / explicit if explicit else home / expected
+ assert _same(values["dir"], wanted), values
+ assert values["migrate"] == migrate
+
+
+PS_CHOICE_DRIVER = """$ErrorActionPreference = 'Stop'
+. $env:TEST_BLOCK_FILE
+Write-Host "VALUE|dir|$InstallDir"
+Write-Host "VALUE|migrate|$([int]$MigrateLegacyInstallDir)"
+"""
+
+
+@needs_powershell
[email protected](("legacy_state", "explicit", "expected", "migrate"), CHOICE_CASES)
+def test_ps1_picks_the_earlier_folder_only_while_it_is_a_real_directory(
+ tmp_path: Path, legacy_state: str, explicit: str | None, expected: str, migrate: str
+) -> None:
+ home = _home(tmp_path, legacy_state)
+ block = tmp_path / "block.ps1"
+ block.write_text(_block(INSTALL_PS1, "install-dir-choice"), encoding="utf-8")
+ driver = tmp_path / "driver.ps1"
+ driver.write_text(PS_CHOICE_DRIVER, encoding="utf-8")
+ env = {**_base_env(), "USERPROFILE": str(home), "TEST_BLOCK_FILE": str(block)}
+ if explicit:
+ env["JARVIS_INSTALL_DIR"] = str(tmp_path / explicit)
+
+ result = _run_powershell(driver, env)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ values = _values(result.stdout)
+ wanted = tmp_path / explicit if explicit else home / expected
+ assert _same(values["dir"], wanted), values
+ assert values["migrate"] == migrate
+
+
+# --------------------------------------------------------------------------- #
+# The move on an update run #
+# --------------------------------------------------------------------------- #
+# Deep temporary directories exceed the classic Windows path limit inside
+# ``.git/objects``; every git run here, the scripts' included, lifts it.
+_LONG_PATHS = {"GIT_CONFIG_COUNT": "1", "GIT_CONFIG_KEY_0": "core.longpaths",
+ "GIT_CONFIG_VALUE_0": "true"}
+
+
+def _git(args: list[str], cwd: Path) -> None:
+ assert GIT is not None
+ done = subprocess.run( # noqa: S603 - test-controlled command
+ [GIT, *args],
+ cwd=str(cwd),
+ capture_output=True,
+ text=True,
+ check=False,
+ env={**os.environ, **_LONG_PATHS},
+ )
+ assert done.returncode == 0, done.stderr
+
+
+def _legacy_checkout(tmp_path: Path, *, with_engine: bool = True) -> Path:
+ """``~/.personal-jarvis`` cloned from a release whose main carries the engine."""
+ home = tmp_path / "home"
+ home.mkdir()
+ seed = tmp_path / "seed"
+ _git(["init", "--quiet", "-b", "main", str(seed)], tmp_path)
+ _git(["config", "user.email", "[email protected]"], seed)
+ _git(["config", "user.name", "Tester"], seed)
+ if with_engine:
+ target = seed / ENGINE_PATH
+ target.parent.mkdir(parents=True)
+ shutil.copyfile(ENGINE, target)
+ (seed / "README.md").write_text("release\n", encoding="utf-8")
+ _git(["add", "-A"], seed)
+ _git(["commit", "--quiet", "-m", "release"], seed)
+ install = home / LEGACY
+ _git(["clone", "--quiet", str(seed), str(install)], tmp_path)
+ (install / "data").mkdir()
+ (install / "data" / "keep.txt").write_text("user data\n", encoding="utf-8")
+ return home
+
+
+SH_MOVE_DRIVER = """#!/usr/bin/env bash
+set -euo pipefail
+note() { printf 'NOTE|%s\\n' "$*"; }
+source "$BLOCK_FILE"
+printf 'VALUE|dir|%s\\n' "$INSTALL_DIR"
+printf 'VALUE|migrate|%s\\n' "$MIGRATE_LEGACY_INSTALL_DIR"
+"""
+
+
+def _run_sh_move(tmp_path: Path, home: Path, *, migrate: str = "1") -> dict[str, str]:
+ block = tmp_path / "move.sh"
+ # Sourced at the top level, the block's early ``return 0`` ends the source
+ # exactly as it ends the function in the script.
+ block.write_text(_block(INSTALL_SH, "migrate-install-dir"), encoding="utf-8", newline="\n")
+ driver = tmp_path / "move-driver.sh"
+ driver.write_text(SH_MOVE_DRIVER, encoding="utf-8", newline="\n")
+ scratch = tmp_path / "tmp"
+ scratch.mkdir()
+ env = {
+ **_base_env(),
+ "BLOCK_FILE": _sh_path(block),
+ "HOME": _sh_path(home),
+ "TMPDIR": _sh_path(scratch),
+ "PYTHON_EXE": sys.executable,
+ "BRANCH": "main",
+ "IDENTITY_ENGINE_PATH": ENGINE_PATH,
+ "INSTALL_DIR": _sh_path(home / LEGACY),
+ "LEGACY_INSTALL_DIR": _sh_path(home / LEGACY),
+ "CURRENT_INSTALL_DIR": _sh_path(home / CURRENT),
+ "MIGRATE_LEGACY_INSTALL_DIR": migrate,
+ **_LONG_PATHS,
+ }
+ result = _run([str(BASH), str(driver)], env)
+ assert result.returncode == 0, result.stderr + result.stdout
+ # The engine's temporary copy is gone again.
+ assert list(scratch.iterdir()) == []
+ return {**_values(result.stdout), "stdout": result.stdout}
+
+
+@needs_bash
+@needs_git
+def test_sh_moves_the_install_and_leaves_a_link_at_the_earlier_name(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path)
+
+ values = _run_sh_move(tmp_path, home)
+
+ assert _same(values["dir"], home / CURRENT), values["stdout"]
+ assert (home / CURRENT / "data" / "keep.txt").read_text(encoding="utf-8") == "user data\n"
+ assert is_directory_link(home / LEGACY)
+ assert (home / LEGACY / "data" / "keep.txt").is_file()
+ assert values["migrate"] == "0"
+ assert "moved the install to" in values["stdout"]
+
+
+@needs_bash
+@needs_git
+def test_sh_keeps_the_install_in_place_when_the_new_name_is_taken(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path)
+ (home / CURRENT).mkdir()
+
+ values = _run_sh_move(tmp_path, home)
+
+ assert _same(values["dir"], home / LEGACY), values["stdout"]
+ assert not is_directory_link(home / LEGACY)
+ assert "kept the install in" in values["stdout"]
+ assert "both_exist" in values["stdout"]
+
+
+@needs_bash
+@needs_git
+def test_sh_keeps_the_install_in_place_when_the_release_has_no_engine(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path, with_engine=False)
+
+ values = _run_sh_move(tmp_path, home)
+
+ assert _same(values["dir"], home / LEGACY), values["stdout"]
+ assert not (home / CURRENT).exists()
+ assert "did not run" in values["stdout"]
+
+
+@needs_bash
+@needs_git
+def test_sh_leaves_an_install_it_did_not_choose_alone(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path)
+
+ values = _run_sh_move(tmp_path, home, migrate="0")
+
+ assert _same(values["dir"], home / LEGACY)
+ assert not (home / CURRENT).exists()
+ assert "NOTE|" not in values["stdout"]
+
+
+PS_MOVE_DRIVER = """$ErrorActionPreference = 'Stop'
+function Write-Note([string]$Text) { Write-Host "NOTE|$Text" }
+$InstallDir = $env:TEST_INSTALL_DIR
+$LegacyInstallDir = $env:TEST_LEGACY_DIR
+$CurrentInstallDir = $env:TEST_CURRENT_DIR
+$Branch = 'main'
+$IdentityEnginePath = $env:TEST_ENGINE_PATH
+$pythonExe = $env:TEST_PYTHON
+$MigrateLegacyInstallDir = [bool][int]$env:TEST_MIGRATE
+. $env:TEST_FUNCTION_FILE
+$InstallDir = [string](Invoke-InstallDirMigration)
+Write-Host "VALUE|dir|$InstallDir"
+"""
+
+
+def _run_ps_move(tmp_path: Path, home: Path, *, migrate: str = "1") -> dict[str, str]:
+ function = tmp_path / "move.ps1"
+ function.write_text(_ps_function(INSTALL_PS1, "Invoke-InstallDirMigration"), encoding="utf-8")
+ scratch = tmp_path / "tmp"
+ scratch.mkdir()
+ driver = tmp_path / "move-driver.ps1"
+ driver.write_text(PS_MOVE_DRIVER, encoding="utf-8")
+ env = {
+ **_base_env(),
+ "USERPROFILE": str(home),
+ "TEST_FUNCTION_FILE": str(function),
+ "TEST_INSTALL_DIR": str(home / LEGACY),
+ "TEST_LEGACY_DIR": str(home / LEGACY),
+ "TEST_CURRENT_DIR": str(home / CURRENT),
+ "TEST_ENGINE_PATH": ENGINE_PATH,
+ "TEST_PYTHON": sys.executable,
+ "TEST_MIGRATE": migrate,
+ # Where the engine's temporary copy goes ([IO.Path]::GetTempPath()).
+ "TEMP": str(scratch),
+ "TMP": str(scratch),
+ **_LONG_PATHS,
+ }
+ result = _run_powershell(driver, env)
+ assert result.returncode == 0, result.stderr + result.stdout
+ # The engine's temporary copy is gone again.
+ assert list(scratch.iterdir()) == []
+ return {**_values(result.stdout), "stdout": result.stdout}
+
+
+@needs_powershell
+@needs_git
+def test_ps1_moves_the_install_and_leaves_a_link_at_the_earlier_name(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path)
+
+ values = _run_ps_move(tmp_path, home)
+
+ assert _same(values["dir"], home / CURRENT), values["stdout"]
+ assert (home / CURRENT / "data" / "keep.txt").read_text(encoding="utf-8") == "user data\n"
+ assert is_directory_link(home / LEGACY)
+ # The engine ran from a byte-exact copy of the fetched file.
+ assert "moved the install to" in values["stdout"]
+
+
+@needs_powershell
+@needs_git
+def test_ps1_leaves_an_install_it_did_not_choose_alone(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path)
+
+ values = _run_ps_move(tmp_path, home, migrate="0")
+
+ assert _same(values["dir"], home / LEGACY)
+ assert not (home / CURRENT).exists()
+ assert "NOTE|" not in values["stdout"]
+
+
+@needs_powershell
+@needs_git
+def test_ps1_keeps_the_install_in_place_when_the_release_has_no_engine(tmp_path: Path) -> None:
+ home = _legacy_checkout(tmp_path, with_engine=False)
+
+ values = _run_ps_move(tmp_path, home)
+
+ assert _same(values["dir"], home / LEGACY), values["stdout"]
+ assert not (home / CURRENT).exists()
+ assert "did not run" in values["stdout"]
+
+
+# --------------------------------------------------------------------------- #
+# Uninstall: the folder, never through a link #
+# --------------------------------------------------------------------------- #
+SH_UNINSTALL_CHOICE_DRIVER = """#!/usr/bin/env bash
+set -euo pipefail
+DEFAULT_INSTALL_DIR_NAME="$TEST_CURRENT_NAME"
+LEGACY_INSTALL_DIR_NAME="$TEST_LEGACY_NAME"
+source "$BLOCK_FILE"
+printf 'VALUE|dir|%s\\n' "$INSTALL_DIR"
+"""
+
+
+@needs_bash
+ ("legacy_state", "variables", "expected"),
+ [
+ ("absent", {}, CURRENT),
+ ("real", {}, LEGACY),
+ ("link", {}, CURRENT),
+ ("real", {"JARVIS_INSTALL_DIR": "old-option"}, "old-option"),
+ ("real", {"DODAIOS_INSTALL_DIR": "new-option"}, "new-option"),
+ ("real", {"JARVIS_INSTALL_DIR": "old-option", "DODAIOS_INSTALL_DIR": "new-option"},
+ "new-option"),
+ ],
+)
+def test_the_shell_uninstaller_targets_the_folder_an_install_uses(
+ tmp_path: Path, legacy_state: str, variables: dict[str, str], expected: str
+) -> None:
+ home = _home(tmp_path, legacy_state)
+ block = tmp_path / "block.sh"
+ block.write_text(_block(UNINSTALL_SH, "uninstall-dir"), encoding="utf-8", newline="\n")
+ driver = tmp_path / "driver.sh"
+ driver.write_text(SH_UNINSTALL_CHOICE_DRIVER, encoding="utf-8", newline="\n")
+ env = {
+ **_base_env(),
+ "HOME": _sh_path(home),
+ "BLOCK_FILE": _sh_path(block),
+ "TEST_CURRENT_NAME": CURRENT,
+ "TEST_LEGACY_NAME": LEGACY,
+ **{name: _sh_path(tmp_path / value) for name, value in variables.items()},
+ }
+
+ result = _run([str(BASH), str(driver)], env)
+
+ assert result.returncode == 0, result.stderr
+ wanted = tmp_path / expected if variables else home / expected
+ assert _same(_values(result.stdout)["dir"], wanted)
+
+
+def _moved_install(tmp_path: Path) -> tuple[Path, Path]:
+ """``~/.dodaios`` with a link at ``~/.personal-jarvis``, and an unrelated folder."""
+ home = tmp_path / "home"
+ (home / CURRENT / "data").mkdir(parents=True)
+ (home / CURRENT / "data" / "keep.txt").write_text("x\n", encoding="utf-8")
+ create_directory_link(home / LEGACY, home / CURRENT)
+ elsewhere = tmp_path / "elsewhere"
+ elsewhere.mkdir()
+ (elsewhere / "canary.txt").write_text("not ours\n", encoding="utf-8")
+ return home, elsewhere
+
+
+SH_REMOVE_DRIVER = """#!/usr/bin/env bash
+set -euo pipefail
+note() { printf 'NOTE|%s\\n' "$*"; }
+err() { printf 'ERR|%s\\n' "$*"; }
+stop_running_instances() { printf 'STOP|%s\\n' "$1"; }
+DEFAULT_INSTALL_DIR_NAME="$TEST_CURRENT_NAME"
+LEGACY_INSTALL_DIR_NAME="$TEST_LEGACY_NAME"
+remove_install_dir() {
+ source "$BLOCK_FILE"
+}
+remove_install_dir "$TEST_GIVEN"
+printf 'DONE\\n'
+"""
+
+
+def _run_sh_remove(tmp_path: Path, home: Path, given: Path) -> subprocess.CompletedProcess[str]:
+ block = tmp_path / "remove.sh"
+ block.write_text(_block(UNINSTALL_SH, "uninstall-remove"), encoding="utf-8", newline="\n")
+ driver = tmp_path / "remove-driver.sh"
+ driver.write_text(SH_REMOVE_DRIVER, encoding="utf-8", newline="\n")
+ env = {
+ **_base_env(),
+ "HOME": _sh_path(home),
+ "BLOCK_FILE": _sh_path(block),
+ "TEST_GIVEN": _sh_path(given),
+ "TEST_CURRENT_NAME": CURRENT,
+ "TEST_LEGACY_NAME": LEGACY,
+ }
+ return _run([str(BASH), str(driver)], env)
+
+
+@needs_bash
[email protected]("given_name", [CURRENT, LEGACY])
+def test_the_shell_uninstaller_removes_the_link_as_a_link_then_the_folder(
+ tmp_path: Path, given_name: str
+) -> None:
+ home, _elsewhere = _moved_install(tmp_path)
+
+ result = _run_sh_remove(tmp_path, home, home / given_name)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert "DONE" in result.stdout
+ assert not os.path.lexists(home / LEGACY)
+ assert not os.path.lexists(home / CURRENT)
+
+
+@needs_bash
+def test_the_shell_uninstaller_never_touches_a_link_that_leads_elsewhere(tmp_path: Path) -> None:
+ home = tmp_path / "home"
+ (home / CURRENT).mkdir(parents=True)
+ elsewhere = tmp_path / "elsewhere"
+ elsewhere.mkdir()
+ (elsewhere / "canary.txt").write_text("not ours\n", encoding="utf-8")
+ create_directory_link(home / LEGACY, elsewhere)
+
+ result = _run_sh_remove(tmp_path, home, home / CURRENT)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert not os.path.lexists(home / CURRENT)
+ assert is_directory_link(home / LEGACY)
+ assert (elsewhere / "canary.txt").read_text(encoding="utf-8") == "not ours\n"
+
+
+PS_REMOVE_DRIVER = """$ErrorActionPreference = 'Stop'
+function Write-Note([string]$Text) { Write-Host "NOTE|$Text" }
+function Write-Ok([string]$Text) { Write-Host "OK|$Text" }
+function Write-Err([string]$Text) { Write-Host "ERR|$Text" }
+function Stop-JarvisProcesses([string]$Root) { Write-Host "STOP|$Root" }
+$DefaultInstallDirName = $env:TEST_CURRENT_NAME
+$LegacyInstallDirName = $env:TEST_LEGACY_NAME
+. $env:TEST_CHOICE_FILE
+. $env:TEST_REMOVE_FILE
+Write-Host 'DONE'
+"""
+
+
+def _run_ps_remove(
+ tmp_path: Path, home: Path, given: Path | None
+) -> subprocess.CompletedProcess[str]:
+ choice = tmp_path / "choice.ps1"
+ choice.write_text(_block(UNINSTALL_PS1, "uninstall-dir"), encoding="utf-8")
+ remove = tmp_path / "remove.ps1"
+ remove.write_text(_block(UNINSTALL_PS1, "uninstall-remove"), encoding="utf-8")
+ driver = tmp_path / "remove-driver.ps1"
+ driver.write_text(PS_REMOVE_DRIVER, encoding="utf-8")
+ env = {
+ **_base_env(),
+ "USERPROFILE": str(home),
+ "TEST_CHOICE_FILE": str(choice),
+ "TEST_REMOVE_FILE": str(remove),
+ "TEST_CURRENT_NAME": CURRENT,
+ "TEST_LEGACY_NAME": LEGACY,
+ }
+ if given is not None:
+ env["JARVIS_INSTALL_DIR"] = str(given)
+ return _run_powershell(driver, env)
+
+
+@needs_powershell
[email protected]("given_name", [None, LEGACY])
+def test_the_powershell_uninstaller_removes_the_junction_as_a_link_then_the_folder(
+ tmp_path: Path, given_name: str | None
+) -> None:
+ home, elsewhere = _moved_install(tmp_path)
+
+ result = _run_ps_remove(tmp_path, home, home / given_name if given_name else None)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert "DONE" in result.stdout
+ assert f"OK|Removed the link {home / LEGACY}" in result.stdout
+ assert not os.path.lexists(home / LEGACY)
+ assert not os.path.lexists(home / CURRENT)
+ assert (elsewhere / "canary.txt").is_file()
+
+
+@needs_powershell
+def test_the_powershell_uninstaller_never_touches_a_link_that_leads_elsewhere(
+ tmp_path: Path,
+) -> None:
+ home = tmp_path / "home"
+ (home / CURRENT).mkdir(parents=True)
+ elsewhere = tmp_path / "elsewhere"
+ elsewhere.mkdir()
+ (elsewhere / "canary.txt").write_text("not ours\n", encoding="utf-8")
+ create_directory_link(home / LEGACY, elsewhere)
+
+ result = _run_ps_remove(tmp_path, home, None)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert not os.path.lexists(home / CURRENT)
+ assert is_directory_link(home / LEGACY)
+ assert (elsewhere / "canary.txt").read_text(encoding="utf-8") == "not ours\n"
diff --git a/tests/unit/install/test_install_option_names.py b/tests/unit/install/test_install_option_names.py
index 91e5410ea0..0e59800f58 100644
--- a/tests/unit/install/test_install_option_names.py
+++ b/tests/unit/install/test_install_option_names.py
@@ -278,41 +278,6 @@ def test_the_scripts_spell_the_prefixes_the_app_uses(path: Path) -> None:
assert old_prefix in source
-@needs_bash
- ("variables", "expected"),
- [
- ({"DODAIOS_INSTALL_DIR": "new-dir"}, "new-dir"),
- ({"JARVIS_INSTALL_DIR": "old-dir"}, "old-dir"),
- ({"JARVIS_INSTALL_DIR": "old-dir", "DODAIOS_INSTALL_DIR": "new-dir"}, "new-dir"),
- ({}, "HOME/.default"),
- ],
-)
-def test_the_shell_uninstaller_targets_the_directory_either_name_gives(
- tmp_path: Path, variables: dict[str, str], expected: str
-) -> None:
- # The line that picks the directory: run exactly that, never the removal
- # below it.
- source = UNINSTALL_SH.read_text(encoding="utf-8")
- match = re.search(r"^INSTALL_DIR=[^\n]*\n", source, re.M)
- assert match is not None, "uninstall.sh no longer resolves INSTALL_DIR the tested way"
- script = tmp_path / "resolve.sh"
- script.write_text(
- "set -euo pipefail\n"
- 'HOME="HOME"\n'
- 'DEFAULT_INSTALL_DIR_NAME=".default"\n'
- + match.group(0)
- + 'printf "%s\\n" "$INSTALL_DIR"\n',
- encoding="utf-8",
- newline="\n",
- )
-
- result = _run([BASH, str(script)], {**_base_env(), **variables})
-
- assert result.returncode == 0, result.stderr
- assert result.stdout.strip() == expected
-
-
def test_the_appimage_launcher_reads_its_switch_under_both_prefixes() -> None:
# AppRun is POSIX sh and runs before the app: the new spelling first, the
# earlier one as its fallback.
diff --git a/tests/unit/install/test_install_salvage_copy.py b/tests/unit/install/test_install_salvage_copy.py
index 59c2a4f336..8a036b2d60 100644
--- a/tests/unit/install/test_install_salvage_copy.py
+++ b/tests/unit/install/test_install_salvage_copy.py
@@ -32,7 +32,8 @@ DRIVER = """#!/usr/bin/env bash
set -u
note() { printf 'NOTE|%s\\n' "$*"; }
err() { printf 'ERR|%s\\n' "$*" >&2; }
-CONFIG_FILE_NAME="jarvis.toml"
+CONFIG_FILE_NAME="dodaios.toml"
+LEGACY_CONFIG_FILE_NAME="jarvis.toml"
salvage_copy() {
source "$BLOCK_FILE"
}
diff --git a/tests/unit/install/test_installer_flow.py b/tests/unit/install/test_installer_flow.py
index a648926e28..9e4fb88046 100644
--- a/tests/unit/install/test_installer_flow.py
+++ b/tests/unit/install/test_installer_flow.py
@@ -257,7 +257,7 @@ def test_full_profile_failure_stops_desktop_install(monkeypatch) -> None:
def test_macos_launch_enters_through_application_bundle(monkeypatch, tmp_path, capsys) -> None:
launched: dict[str, object] = {}
- bundle = tmp_path / "Personal Jarvis.app"
+ bundle = tmp_path / "Dodaios.app"
monkeypatch.setattr(installer.sys, "platform", "darwin")
monkeypatch.setattr(
"dodaios.setup.macos_app_bundle.macos_app_bundle_path", lambda: bundle
@@ -283,7 +283,7 @@ def test_macos_launch_enters_through_application_bundle(monkeypatch, tmp_path, c
# hit: outro said "Launching…" but nothing opened, with no recovery path).
out = capsys.readouterr().out
assert "If it doesn't open, run:" in out
- assert 'open -a "Personal Jarvis"' in out
+ assert 'open -a "Dodaios"' in out
def test_launch_fallback_hint_is_shown_on_every_desktop_os(monkeypatch, capsys) -> None:
@@ -317,7 +317,7 @@ def test_linux_gui_gets_full_profile_and_app_menu_registration(
assert rc == 0
assert ".[full]" in out
assert "repair desktop-shell registration" in out
- assert 'app menu -> "Personal Jarvis"' in out
+ assert 'app menu -> "Dodaios"' in out
def test_update_summary_promises_no_reonboarding(monkeypatch, capsys, tmp_path) -> None:
@@ -366,3 +366,28 @@ def test_a_spotlight_probe_that_cannot_run_never_fails_the_install(
monkeypatch.setattr(installer.subprocess, "run", _boom)
installer._note_stalled_spotlight()
+
+
+def test_the_macos_step_renames_the_bundle_before_the_desktop_step(monkeypatch, capsys) -> None:
+ """The updater of the release before starts the app from the bundle name the
+ contract states, so the rename runs with or without the desktop profile."""
+ import dodaios.setup.macos_app_bundle as bundle_module
+
+ calls: list[str] = []
+ monkeypatch.setattr(installer.sys, "platform", "darwin")
+ monkeypatch.setattr(
+ bundle_module,
+ "rename_legacy_macos_app_bundles",
+ lambda: calls.append("rename") or [Path("/Applications/Dodaios.app")],
+ )
+
+ installer.step_macos_bundle_name(dry_run=False)
+
+ assert calls == ["rename"]
+ assert "Dodaios.app" in capsys.readouterr().out
+ installer.step_macos_bundle_name(dry_run=True)
+ assert calls == ["rename"]
+ source = Path(installer.__file__).read_text(encoding="utf-8")
+ assert source.index("step_macos_bundle_name(dry_run=args.dry_run)") < source.index(
+ "if not step_desktop_integration(enabled=with_desktop"
+ )
diff --git a/tests/unit/install/test_installer_legacy_distribution.py b/tests/unit/install/test_installer_legacy_distribution.py
new file mode 100644
index 0000000000..f54d413193
--- /dev/null
+++ b/tests/unit/install/test_installer_legacy_distribution.py
@@ -0,0 +1,104 @@
+"""The installer retires the distribution's earlier name before it installs the current one.
+
+Both names own the same package files. pip installing ``dodaios`` and only
+then uninstalling ``personal-jarvis`` would delete files ``dodaios`` needs, so
+the uninstall has to come first (and only when the earlier name is there).
+"""
+
+import importlib.util
+from pathlib import Path
+
+import pytest
+
+REPO = Path(__file__).resolve().parents[3]
+_spec = importlib.util.spec_from_file_location("installer", REPO / "install" / "installer.py")
+installer = importlib.util.module_from_spec(_spec)
+_spec.loader.exec_module(installer)
+
+
+def _site_packages(root: Path, platform: str) -> Path:
+ if platform == "win32":
+ return root / ".venv" / "Lib" / "site-packages"
+ return root / ".venv" / "lib" / "python3.12" / "site-packages"
+
+
[email protected]("platform", ["win32", "linux", "darwin"])
+ "record",
+ [
+ "personal_jarvis-3.2.0.dist-info",
+ "personal-jarvis.egg-link",
+ "personal_jarvis.egg-link",
+ ],
+)
+def test_an_install_from_before_the_rename_is_found(monkeypatch, tmp_path, platform, record):
+ monkeypatch.setattr(installer.sys, "platform", platform)
+ monkeypatch.setattr(installer, "repo_root", lambda: tmp_path)
+ site = _site_packages(tmp_path, platform)
+ site.mkdir(parents=True)
+ (site / "dodaios-3.3.0.dist-info").mkdir()
+ assert installer.installed_legacy_distributions() == ()
+ target = site / record
+ if record.endswith(".dist-info"):
+ target.mkdir()
+ else:
+ target.write_text(str(tmp_path), encoding="utf-8")
+ assert installer.installed_legacy_distributions() == ("personal-jarvis",)
+
+
+def test_no_environment_yet_means_nothing_to_retire(monkeypatch, tmp_path):
+ monkeypatch.setattr(installer, "repo_root", lambda: tmp_path)
+ assert installer.installed_legacy_distributions() == ()
+
+
+def _commands(monkeypatch, legacy: tuple[str, ...], *, desktop: bool) -> list[list[str]]:
+ commands: list[list[str]] = []
+
+ def capture(command, **_kwargs):
+ commands.append(command)
+ return 0
+
+ monkeypatch.setattr(installer, "installed_legacy_distributions", lambda: legacy)
+ monkeypatch.setattr(installer, "run_quiet", capture)
+ monkeypatch.setattr(installer, "repair_distribution_metadata", lambda **_kwargs: True)
+ installer.step_pip_install(with_desktop=desktop, with_voice_local=False, dry_run=False)
+ return commands
+
+
[email protected]("desktop", [True, False])
+def test_the_earlier_name_is_uninstalled_before_anything_is_installed(monkeypatch, desktop):
+ commands = _commands(monkeypatch, ("personal-jarvis",), desktop=desktop)
+ pip = [str(installer.venv_python()), "-m", "pip"]
+ assert commands[0] == [*pip, "uninstall", "-y", "personal-jarvis"]
+ assert all("uninstall" not in command for command in commands[1:])
+ assert commands[1][len(pip) :] == ["install", "-e", ".", "--no-deps"]
+
+
+def test_a_current_install_runs_no_uninstall(monkeypatch):
+ commands = _commands(monkeypatch, (), desktop=True)
+ assert not any("uninstall" in command for command in commands)
+
+
+def test_a_failed_uninstall_stops_the_install(monkeypatch):
+ monkeypatch.setattr(installer, "installed_legacy_distributions", lambda: ("personal-jarvis",))
+ monkeypatch.setattr(installer, "repair_distribution_metadata", lambda **_kwargs: True)
+ commands: list[list[str]] = []
+
+ def fail_uninstall(command, **_kwargs):
+ commands.append(command)
+ return 1 if "uninstall" in command else 0
+
+ monkeypatch.setattr(installer, "run_quiet", fail_uninstall)
+ with pytest.raises(SystemExit, match="2"):
+ installer.step_pip_install(with_desktop=True, with_voice_local=False, dry_run=False)
+ assert len(commands) == 1
+
+
+def test_the_dry_run_names_the_retirement(monkeypatch, capsys):
+ monkeypatch.setattr(installer, "installed_legacy_distributions", lambda: ("personal-jarvis",))
+ installer.step_pip_install(with_desktop=True, with_voice_local=False, dry_run=True)
+ # The console wraps long lines at the terminal's width (narrow on CI), so
+ # compare the output with its whitespace folded.
+ out = " ".join(capsys.readouterr().out.replace("│", " ").split())
+ assert "retire the earlier package name (personal-jarvis)" in out
+ assert out.index("uninstall -y personal-jarvis") < out.index("install -e . --no-deps")
diff --git a/tests/unit/install/test_installer_update_contract.py b/tests/unit/install/test_installer_update_contract.py
index e957359ff2..a753d9eec9 100644
--- a/tests/unit/install/test_installer_update_contract.py
+++ b/tests/unit/install/test_installer_update_contract.py
@@ -42,6 +42,32 @@ def test_managed_marker_persists_install_profile(
assert payload["desktop"] is with_desktop
+def test_managed_marker_is_written_under_every_name(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ # An updater from before the rename knows only the earlier name.
+ monkeypatch.setattr(installer, "repo_root", lambda: tmp_path)
+ installer.write_managed_marker(with_desktop=True)
+
+ names = (".dodaios-managed-install", ".jarvis-managed-install")
+ payloads = [json.loads((tmp_path / name).read_text(encoding="utf-8")) for name in names]
+ assert payloads[0] == payloads[1]
+ assert payloads[0]["install_path"] == str(tmp_path)
+
+
+ "present", [(), (".dodaios-managed-install",), (".jarvis-managed-install",)]
+)
+def test_an_update_run_is_recognised_by_either_marker(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path, present: tuple[str, ...]
+) -> None:
+ monkeypatch.setattr(installer, "repo_root", lambda: tmp_path)
+ for name in present:
+ (tmp_path / name).write_text("{}", encoding="utf-8")
+
+ assert installer.is_update_run() is bool(present)
+
+
def test_desktop_dependency_plan_is_complete_and_verified(capsys) -> None:
installer.step_pip_install(
with_desktop=True,
@@ -222,4 +248,4 @@ def test_macos_launch_survives_missing_editable_import(
installer.step_launch(headless=False, dry_run=True)
out = capsys.readouterr().out
- assert "/usr/bin/open -a Personal Jarvis" in out
+ assert "/usr/bin/open -a Dodaios" in out
diff --git a/tests/unit/install/test_linux_entry_rename.py b/tests/unit/install/test_linux_entry_rename.py
new file mode 100644
index 0000000000..081eb2e56a
--- /dev/null
+++ b/tests/unit/install/test_linux_entry_rename.py
@@ -0,0 +1,155 @@
+"""The shell uninstaller's fallback removes only this install's Linux entries.
+
+Without a working virtual environment ``install/uninstall.sh`` cannot ask the
+tested Python cleanup, so it removes the desktop entries itself: the login
+autostart entry under the current and the earlier file name, and the
+application-menu entry under the earlier name. An entry under the earlier name
+can belong to another install on the same machine, so each one goes only when
+its working folder is this install's folder, also through the link the install
+folder move left at the earlier path. The block runs in a real bash against a
+real temporary home.
+"""
+
+from __future__ import annotations
+
+import os
+import shutil
+import subprocess
+from pathlib import Path
+
+import pytest
+
+from dodaios.core import branding
+from dodaios.core.identity_migration import create_directory_link
+from dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGS
+
+_ROOT = Path(__file__).resolve().parents[3]
+UNINSTALL_SH = _ROOT / "install" / "uninstall.sh"
+CURRENT_ENTRY = branding.LINUX_DESKTOP_ENTRY_FILE_NAME
+LEGACY_ENTRY = branding.LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES[0]
+
+
+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")
+ # On Windows the first ``bash`` on PATH can be the WSL launcher stub.
+ if bash and not any(part in bash.lower() for part in ("windowsapps", "system32")):
+ return bash
+ return None
+
+
+BASH = _find_bash()
+pytestmark = pytest.mark.skipif(BASH is None, reason="no usable bash on this host")
+
+DRIVER = """set -euo pipefail
+note() { printf 'NOTE|%s\\n' "$1"; }
+LINUX_DESKTOP_ENTRY_FILE_NAME="$TEST_CURRENT_ENTRY"
+LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES="$TEST_LEGACY_ENTRY"
+remove_linux_entries_of_install() {
+. "$BLOCK_FILE"
+}
+remove_linux_entries_of_install "$TEST_INSTALL_DIR"
+printf 'DONE\\n'
+"""
+
+
+def _sh_path(path: Path) -> str:
+ return str(path).replace("\\", "/")
+
+
+def _block() -> str:
+ text = UNINSTALL_SH.read_text(encoding="utf-8")
+ begin = "# --- uninstall-linux-entries begin"
+ end = "# --- uninstall-linux-entries end"
+ assert begin in text and end in text, "the uninstall-linux-entries markers vanished"
+ body = text.split(begin, 1)[1].split(end, 1)[0]
+ return body.split("\n", 1)[1]
+
+
+def _entry(path: Path, working_dir: Path) -> Path:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ path.write_text(
+ "[Desktop Entry]\nType=Application\nName=Personal Jarvis\n"
+ "Exec=/usr/bin/python3 -m jarvis.ui.web.launcher\n"
+ f"Path={_sh_path(working_dir)}\n",
+ encoding="utf-8",
+ )
+ return path
+
+
+def _run(tmp_path: Path, home: Path, install_dir: Path) -> subprocess.CompletedProcess[str]:
+ block = tmp_path / "linux-entries.sh"
+ block.write_text(_block(), encoding="utf-8", newline="\n")
+ driver = tmp_path / "linux-entries-driver.sh"
+ driver.write_text(DRIVER, encoding="utf-8", newline="\n")
+ env = {
+ key: value
+ for key, value in os.environ.items()
+ if key not in ("XDG_DATA_HOME", "XDG_CONFIG_HOME")
+ }
+ env.update(
+ HOME=_sh_path(home),
+ BLOCK_FILE=_sh_path(block),
+ TEST_INSTALL_DIR=_sh_path(install_dir),
+ TEST_CURRENT_ENTRY=CURRENT_ENTRY,
+ TEST_LEGACY_ENTRY=LEGACY_ENTRY,
+ )
+ return subprocess.run( # noqa: S603 - test-controlled command
+ [str(BASH), str(driver)],
+ capture_output=True,
+ text=True,
+ encoding="utf-8",
+ errors="replace",
+ timeout=120,
+ env=env,
+ creationflags=NO_WINDOW_CREATIONFLAGS,
+ )
+
+
+def test_the_fallback_removes_this_installs_entries_under_both_names(
+ tmp_path: Path,
+) -> None:
+ home = tmp_path / "home"
+ install = home / branding.DEFAULT_INSTALL_DIR_NAME
+ install.mkdir(parents=True)
+ earlier_folder = home / branding.LEGACY_DEFAULT_INSTALL_DIR_NAMES[0]
+ create_directory_link(earlier_folder, install)
+ autostart = home / ".config" / "autostart"
+ apps = home / ".local" / "share" / "applications"
+
+ # Written before the folder moved: the earlier name, through the link.
+ ours_earlier = _entry(autostart / LEGACY_ENTRY, earlier_folder)
+ ours_current = _entry(autostart / CURRENT_ENTRY, install)
+ ours_menu = _entry(apps / LEGACY_ENTRY, install)
+
+ result = _run(tmp_path, home, install)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert "DONE" in result.stdout
+ assert not ours_earlier.exists()
+ assert not ours_current.exists()
+ assert not ours_menu.exists()
+
+
+def test_the_fallback_keeps_an_earlier_entry_of_another_install(tmp_path: Path) -> None:
+ home = tmp_path / "home"
+ install = home / branding.DEFAULT_INSTALL_DIR_NAME
+ install.mkdir(parents=True)
+ other_install = tmp_path / "another checkout"
+ other_install.mkdir()
+ autostart = home / ".config" / "autostart"
+ apps = home / ".local" / "share" / "applications"
+ theirs_autostart = _entry(autostart / LEGACY_ENTRY, other_install)
+ theirs_menu = _entry(apps / LEGACY_ENTRY, other_install)
+
+ result = _run(tmp_path, home, install)
+
+ assert result.returncode == 0, result.stderr + result.stdout
+ assert theirs_autostart.exists()
+ assert theirs_menu.exists()
+ assert "it starts another install" in result.stdout
diff --git a/tests/unit/mcp/test_state_portability.py b/tests/unit/mcp/test_state_portability.py
index 3ec15b288c..29e28b3a0c 100644
--- a/tests/unit/mcp/test_state_portability.py
+++ b/tests/unit/mcp/test_state_portability.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import json
+from dodaios.core.branding import WINDOWS_USER_DATA_DIR_NAME
from dodaios.mcp import state
@@ -39,7 +40,7 @@ def test_unwritable_project_config_crosses_to_per_user_storage(
state.save_config({"mcpServers": {"hosted": {"enabled": True}}})
- fallback = tmp_path / "user-data" / "Jarvis" / "mcp.json"
+ fallback = tmp_path / "user-data" / WINDOWS_USER_DATA_DIR_NAME / "mcp.json"
assert fallback.exists()
assert state.load_config()["mcpServers"]["hosted"]["enabled"] is True
diff --git a/tests/unit/packaging/test_frozen_runtime_hook.py b/tests/unit/packaging/test_frozen_runtime_hook.py
index 6e3f43cbf8..00b09a89ec 100644
--- a/tests/unit/packaging/test_frozen_runtime_hook.py
+++ b/tests/unit/packaging/test_frozen_runtime_hook.py
@@ -11,6 +11,7 @@ convention — and the first test below is what stops that copy from drifting.
from __future__ import annotations
import importlib.util
+import os
import sys
from pathlib import Path
from types import ModuleType
@@ -56,7 +57,11 @@ def frozen_bundle(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> tuple[Path
monkeypatch.setenv("LOCALAPPDATA", str(home))
monkeypatch.delenv("JARVIS_CONFIG", raising=False)
monkeypatch.delenv("JARVIS_DATA_DIR", raising=False)
- return meipass, home / "Jarvis"
+ monkeypatch.delenv("JARVIS_INSTANCE", raising=False)
+ # Not the desktop app's executable: these tests are about the paths, and a
+ # helper process never moves a directory.
+ monkeypatch.setattr(sys, "executable", str(tmp_path / "bundle" / "helper"))
+ return meipass, home / "Dodaios"
def test_hook_directory_matches_jarvis_core_paths(
@@ -82,11 +87,13 @@ def test_apply_points_config_and_data_at_the_user_directory(
import os
- assert Path(os.environ["JARVIS_CONFIG"]) == home / "jarvis.toml"
+ # A fresh install writes its config under the current name.
+ assert Path(os.environ["JARVIS_CONFIG"]) == home / "dodaios.toml"
assert Path(os.environ["JARVIS_DATA_DIR"]) == home / "data"
# First run seeds the config from the copy inside the bundle, so the app
# starts on the shipped defaults instead of an empty file.
- assert (home / "jarvis.toml").read_text(encoding="utf-8") == ("[app]\nname = 'bundled'\n")
+ assert (home / "dodaios.toml").read_text(encoding="utf-8") == ("[app]\nname = 'bundled'\n")
+ assert not (home / "jarvis.toml").exists()
def test_apply_never_overwrites_an_existing_user_config(
@@ -99,9 +106,14 @@ def test_apply_never_overwrites_an_existing_user_config(
hook._apply()
+ import os
+
# This is the whole point: an in-place upgrade reinstalls the bundled file
- # and must not touch what the user configured.
+ # and must not touch what the user configured. The file under its earlier
+ # name stays the configuration; nothing is renamed or seeded beside it.
assert (home / "jarvis.toml").read_text(encoding="utf-8") == ("the user's own settings\n")
+ assert Path(os.environ["JARVIS_CONFIG"]) == home / "jarvis.toml"
+ assert not (home / "dodaios.toml").exists()
def test_apply_respects_an_explicit_override(
@@ -149,5 +161,154 @@ def test_apply_still_sets_the_path_when_seeding_fails(
import os
+ assert Path(os.environ["JARVIS_CONFIG"]) == home / "dodaios.toml"
+ assert not (home / "dodaios.toml").exists()
+
+
+# ---------------------------------------------------------------------------
+# The data directory under its earlier name
+# ---------------------------------------------------------------------------
+
+
+def legacy_home(frozen_bundle: tuple[Path, Path]) -> Path:
+ """An installation from before the rename: data and jarvis.toml under the old name."""
+ _meipass, home = frozen_bundle
+ legacy = home.with_name("Jarvis")
+ (legacy / "data").mkdir(parents=True)
+ (legacy / "data" / "memory.db").write_bytes(b"memories")
+ (legacy / "jarvis.toml").write_text("the user's own settings\n", encoding="utf-8")
+ return legacy
+
+
[email protected](params=["DodaiosApp.exe", "PersonalJarvis.exe"])
+def desktop_app(
+ request: pytest.FixtureRequest,
+ tmp_path: Path,
+ monkeypatch: pytest.MonkeyPatch,
+ hook: ModuleType,
+ frozen_bundle: tuple[Path, Path],
+) -> ModuleType:
+ """Run the hook as the desktop app's executable, with no other instance running.
+
+ Under its current name and its earlier one: the bundle ships both, and a
+ pinned taskbar button or a logon task of an earlier release starts the
+ earlier file.
+ """
+ monkeypatch.setattr(sys, "executable", str(tmp_path / "bundle" / request.param))
+ monkeypatch.setattr(sys, "argv", [sys.executable])
+ # A name no live app holds: the real one may be running on this machine.
+ monkeypatch.setattr(hook, "_MUTEX_NAMES", (f"Local\\HookTestNoSuchMutex_{os.getpid()}",))
+ monkeypatch.delenv(hook._REPORT_ENV_VAR, raising=False)
+ return hook
+
+
+def _can_link(tmp_path: Path) -> bool:
+ target = tmp_path / "probe-target"
+ target.mkdir()
+ engine = _load_hook()._load_engine()
+ try:
+ engine.create_directory_link(tmp_path / "probe-link", target)
+ except OSError:
+ return False
+ return True
+
+
+def test_a_helper_resolves_the_legacy_directory_and_moves_nothing(
+ hook: ModuleType, frozen_bundle: tuple[Path, Path], legacy_home: Path
+) -> None:
+ _meipass, home = frozen_bundle
+
+ hook._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == legacy_home / "data"
+ assert Path(os.environ["JARVIS_CONFIG"]) == legacy_home / "jarvis.toml"
+ assert not home.exists()
+
+
+def test_the_desktop_app_moves_the_legacy_directory_and_keeps_jarvis_toml(
+ desktop_app: ModuleType, frozen_bundle: tuple[Path, Path], legacy_home: Path, tmp_path: Path
+) -> None:
+ if not _can_link(tmp_path):
+ pytest.skip("this OS account cannot create a directory link")
+ _meipass, home = frozen_bundle
+
+ desktop_app._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == home / "data"
+ # The config file moved with its directory and kept its name.
assert Path(os.environ["JARVIS_CONFIG"]) == home / "jarvis.toml"
- assert not (home / "jarvis.toml").exists()
+ assert (home / "jarvis.toml").read_text(encoding="utf-8") == "the user's own settings\n"
+ assert not (home / "dodaios.toml").exists()
+ # The old path still reaches the same files.
+ assert (legacy_home / "data" / "memory.db").read_bytes() == b"memories"
+ assert os.environ[desktop_app._REPORT_ENV_VAR].startswith("INFO|Data directory migration")
+
+
+def test_a_dev_instance_of_the_desktop_app_only_resolves(
+ desktop_app: ModuleType,
+ frozen_bundle: tuple[Path, Path],
+ legacy_home: Path,
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ _meipass, home = frozen_bundle
+ monkeypatch.setenv("JARVIS_INSTANCE", "dev")
+
+ desktop_app._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == legacy_home / "data"
+ assert not home.exists()
+
+
+def test_a_running_primary_keeps_the_desktop_app_from_moving_it(
+ desktop_app: ModuleType,
+ frozen_bundle: tuple[Path, Path],
+ legacy_home: Path,
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ _meipass, home = frozen_bundle
+ engine = desktop_app._load_engine()
+ monkeypatch.setattr(engine, "named_mutex_exists", lambda _names: True)
+ monkeypatch.setattr(engine, "lock_file_held", lambda _paths: True)
+ monkeypatch.setattr(desktop_app, "_load_engine", lambda: engine)
+
+ desktop_app._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == legacy_home / "data"
+ assert not home.exists()
+
+
+def test_values_an_earlier_process_exported_follow_the_move(
+ desktop_app: ModuleType,
+ frozen_bundle: tuple[Path, Path],
+ legacy_home: Path,
+ monkeypatch: pytest.MonkeyPatch,
+ tmp_path: Path,
+) -> None:
+ if not _can_link(tmp_path):
+ pytest.skip("this OS account cannot create a directory link")
+ _meipass, home = frozen_bundle
+ # What the hook of the version before exported, inherited by a restart.
+ monkeypatch.setenv("JARVIS_DATA_DIR", str(legacy_home / "data"))
+ monkeypatch.setenv("JARVIS_CONFIG", str(legacy_home / "jarvis.toml"))
+
+ desktop_app._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == home / "data"
+ assert Path(os.environ["JARVIS_CONFIG"]) == home / "jarvis.toml"
+
+
+def test_without_the_engine_the_legacy_directory_still_wins(
+ hook: ModuleType,
+ frozen_bundle: tuple[Path, Path],
+ legacy_home: Path,
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ _meipass, home = frozen_bundle
+ monkeypatch.setattr(hook, "_load_engine", lambda: None)
+
+ hook._apply()
+
+ assert Path(os.environ["JARVIS_DATA_DIR"]) == legacy_home / "data"
+ assert not home.exists()
+ assert hook._user_data_dir() == legacy_home
diff --git a/tests/unit/packaging/test_linux_identity.py b/tests/unit/packaging/test_linux_identity.py
new file mode 100644
index 0000000000..2021152617
--- /dev/null
+++ b/tests/unit/packaging/test_linux_identity.py
@@ -0,0 +1,234 @@
+"""The Linux packages and the running app agree on one identity.
+
+A desktop binds a running window to the desktop entry whose ``StartupWMClass``
+equals the window's class, and shows that entry's icon for it. The class is
+pinned at runtime (``dodaios.ui.icon_utils.pin_linux_wm_class``) and written
+into three entries: the AppImage's and the Debian package's
+(``packaging/linux/make_desktop_entry.py``), the source install's menu entry
+(``ensure_linux_desktop_entry``) and the login autostart entry
+(``dodaios.autostart.linux``). One of them drifting leaves the dock with a
+generic icon and the app listed twice, without any error anywhere.
+
+The package scripts only run on Linux, so their names are read from the script
+text: the Debian control file is rendered from its template here.
+"""
+
+from __future__ import annotations
+
+import importlib.util
+import inspect
+import re
+import sys
+from pathlib import Path
+from types import ModuleType
+
+import pytest
+
+from dodaios.autostart.linux import LinuxAutostart
+from dodaios.autostart.protocol import LaunchSpec
+from dodaios.core import branding
+from dodaios.core.desktop_entry import read_field
+from dodaios.core.installer_update import INSTALLER_ASSET_NAMES
+from dodaios.ui import icon_utils
+
+_ROOT = Path(__file__).resolve().parents[3]
+_BUILD_SH = _ROOT / "packaging" / "linux" / "build.sh"
+_APPRUN = _ROOT / "packaging" / "linux" / "AppRun"
+
+
+def _load_make_desktop_entry() -> ModuleType:
+ path = _ROOT / "packaging" / "linux" / "make_desktop_entry.py"
+ spec = importlib.util.spec_from_file_location("linux_make_desktop_entry", path)
+ assert spec is not None and spec.loader is not None
+ module = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(module)
+ return module
+
+
+def _assignments(script: str) -> dict[str, str]:
+ """``NAME="value"`` lines at the top level of a shell script."""
+ return dict(re.findall(r'^([A-Z_]+)="([^"$]*)"$', script, re.MULTILINE))
+
+
+def _expand(text: str, values: dict[str, str]) -> str:
+ def value(match: re.Match[str]) -> str:
+ name = match.group(1)
+ assert name in values, f"{name} is not a plain assignment in build.sh"
+ return values[name]
+
+ return re.sub(r"\$\{([A-Z_]+)\}", value, text)
+
+
+def _control_file(version: str = "9.9.9") -> dict[str, str]:
+ script = _BUILD_SH.read_text(encoding="utf-8")
+ template = script.split('cat > "${DEB_ROOT}/DEBIAN/control" <<EOF\n', 1)[1]
+ template = template.split("\nEOF\n", 1)[0]
+ rendered = _expand(template, {**_assignments(script), "VERSION": version})
+ fields: dict[str, str] = {}
+ for line in rendered.splitlines():
+ if line and not line.startswith(" "):
+ key, _, value = line.partition(": ")
+ fields[key] = value
+ return fields
+
+
+# --------------------------------------------------------------------------- #
+# One window class everywhere #
+# --------------------------------------------------------------------------- #
+def test_the_runtime_window_class_is_the_class_every_entry_names(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ pinned = inspect.signature(icon_utils.pin_linux_wm_class).parameters["name"].default
+ assert pinned == icon_utils.LINUX_WM_CLASS == branding.LINUX_WM_CLASS
+
+ package_entry = _load_make_desktop_entry().render(exec_name="Jarvis")
+
+ apps = tmp_path / "applications"
+ assert icon_utils.ensure_linux_desktop_entry(applications_dir=apps) is True
+ menu_entry = (apps / branding.LINUX_DESKTOP_ENTRY_FILE_NAME).read_text(encoding="utf-8")
+
+ monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config"))
+ LinuxAutostart().install(LaunchSpec("/usr/bin/python3", ("-m", "x"), str(tmp_path)))
+ autostart_entry = (
+ tmp_path / "config" / "autostart" / branding.LINUX_DESKTOP_ENTRY_FILE_NAME
+ ).read_text(encoding="utf-8")
+
+ for text in (package_entry, menu_entry, autostart_entry):
+ assert read_field(text, "StartupWMClass") == pinned
+ assert read_field(text, "Name") == branding.LINUX_APP_NAME
+
+
+def test_the_entry_and_the_class_carry_the_current_name() -> None:
+ assert branding.LINUX_WM_CLASS == "dodaios"
+ assert branding.LINUX_DESKTOP_ENTRY_FILE_NAME == "dodaios.desktop"
+ assert branding.LINUX_APP_NAME == "Dodaios"
+
+
+def test_the_pin_sets_the_class_through_glib(monkeypatch: pytest.MonkeyPatch) -> None:
+ """``pin_linux_wm_class`` hands the class to GLib, which GTK derives WM_CLASS from."""
+
+ calls: list[str] = []
+
+ class FakeGLib:
+ @staticmethod
+ def set_prgname(name: str) -> None:
+ calls.append(name)
+
+ repository = ModuleType("gi.repository")
+ repository.GLib = FakeGLib # type: ignore[attr-defined]
+ gi = ModuleType("gi")
+ gi.repository = repository # type: ignore[attr-defined]
+ monkeypatch.setitem(sys.modules, "gi", gi)
+ monkeypatch.setitem(sys.modules, "gi.repository", repository)
+ monkeypatch.setattr(icon_utils.sys, "platform", "linux")
+
+ assert icon_utils.pin_linux_wm_class() is True
+ assert calls == [branding.LINUX_WM_CLASS]
+
+
+def test_the_package_entry_names_the_icon_the_packages_install() -> None:
+ values = _assignments(_BUILD_SH.read_text(encoding="utf-8"))
+ icon = values["ICON_FILE_NAME"]
+ assert icon == f"{branding.LINUX_WM_CLASS}.png"
+ module = _load_make_desktop_entry()
+ assert read_field(module.render(), "Icon") == icon.removesuffix(".png")
+ assert values["DESKTOP_FILE_NAME"] == branding.LINUX_DESKTOP_ENTRY_FILE_NAME
+
+
+# --------------------------------------------------------------------------- #
+# The Debian package #
+# --------------------------------------------------------------------------- #
+def test_the_debian_package_takes_over_from_its_earlier_name() -> None:
+ control = _control_file()
+ assert control["Package"] == "dodaios"
+ assert control["Version"] == "9.9.9"
+ # dpkg removes the earlier package while installing this one (Conflicts +
+ # Replaces), and whatever depends on the earlier name stays satisfied.
+ assert control["Replaces"] == "personal-jarvis"
+ assert control["Conflicts"] == "personal-jarvis"
+ assert control["Provides"] == "personal-jarvis"
+
+
+def test_the_debian_package_installs_under_the_current_names() -> None:
+ script = _BUILD_SH.read_text(encoding="utf-8")
+ values = _assignments(script)
+ assert values["DEB_INSTALL_DIR"] == "/opt/Dodaios"
+ assert "/opt/PersonalJarvis" not in script
+ assert values["SHARE_DIR_NAME"] == "dodaios"
+ assert "usr/share/personal-jarvis" not in script
+ # The commands: the current CLI and its earlier names, and the earlier
+ # command that opens the app.
+ assert '\nCLI_EXE_NAMES=("dodaios" "jarvis")\n' in script
+ assert (
+ 'ln -sf "${DEB_INSTALL_DIR}/usr/bin/${cli_name}" "${DEB_ROOT}/usr/bin/${cli_name}"'
+ in script
+ )
+ assert values["LEGACY_APP_COMMAND_NAME"] in branding.LEGACY_CLI_COMMAND_NAMES
+ assert (
+ 'ln -sf "${DEB_INSTALL_DIR}/AppRun" "${DEB_ROOT}/usr/bin/${LEGACY_APP_COMMAND_NAME}"'
+ in script
+ )
+ assert '--exec "${DEB_INSTALL_DIR}/AppRun"' in script
+
+
+def test_apprun_reads_the_marker_from_the_share_dir_the_build_writes() -> None:
+ values = _assignments(_BUILD_SH.read_text(encoding="utf-8"))
+ apprun = _APPRUN.read_text(encoding="utf-8")
+ assert f'BROWSER_UI_MARKER="${{HERE}}/usr/share/{values["SHARE_DIR_NAME"]}/browser-ui"' in (
+ apprun
+ )
+
+
+# --------------------------------------------------------------------------- #
+# Release asset names: the current one, plus the earlier one as an alias #
+# --------------------------------------------------------------------------- #
+def test_the_appimage_is_built_under_its_current_name() -> None:
+ """The build writes the AppImage under the current asset name only; the
+ earlier name is the release's job (dual publishing), not the build's."""
+ script = _BUILD_SH.read_text(encoding="utf-8")
+ current, earlier = INSTALLER_ASSET_NAMES[("linux", "x64")]
+ assert current == "Dodaios-Linux-x86_64.AppImage"
+ assert f'APPIMAGE_PATH="${{OUT_DIR}}/{current}"' in script
+ # The earlier name appears in no command, only in the comment explaining the alias.
+ commands = [line for line in script.splitlines() if not line.lstrip().startswith("#")]
+ assert not any(earlier in line for line in commands)
+
+
+def test_the_release_also_publishes_the_appimage_under_its_earlier_name(tmp_path: Path) -> None:
+ """Installs frozen before the rename only look for PersonalJarvis-*: the
+ release copies the built AppImage to that name, byte for byte."""
+ from scripts.ci.installer_aliases import add_aliases
+ from scripts.ci.release_assets import INSTALLER_NAME_PAIRS, PLATFORM_INSTALLERS
+
+ current, earlier = INSTALLER_ASSET_NAMES[("linux", "x64")]
+ assert earlier == "PersonalJarvis-Linux-x86_64.AppImage"
+ assert (current, earlier) in INSTALLER_NAME_PAIRS
+ assert PLATFORM_INSTALLERS["linux"] == {current, earlier}
+ workflow = (_ROOT / ".github" / "workflows" / "desktop-installers.yml").read_text(
+ encoding="utf-8"
+ )
+ assert "python scripts/ci/installer_aliases.py installers" in workflow
+
+ # Only the AppImage pair matters here; the other installers are stand-ins.
+ for other_current, _ in INSTALLER_NAME_PAIRS:
+ (tmp_path / other_current).write_bytes(b"other installer")
+ (tmp_path / current).write_bytes(b"\x7fELF appimage bytes")
+ written = add_aliases(tmp_path)
+
+ assert earlier in written
+ assert (tmp_path / earlier).read_bytes() == (tmp_path / current).read_bytes()
+
+
+def test_the_deb_keeps_its_earlier_asset_name_while_the_package_is_dodaios() -> None:
+ """The .deb file name keeps the earlier spelling; the package inside it is
+ dodaios and replaces the earlier package."""
+ script = _BUILD_SH.read_text(encoding="utf-8")
+ values = _assignments(script)
+ assert values["DEB_PACKAGE_NAME"] == "dodaios"
+ assert values["LEGACY_DEB_PACKAGE_NAME"] == "personal-jarvis"
+ assert 'DEB_PATH="${OUT_DIR}/personal-jarvis_${VERSION}_amd64.deb"' in script
+ assert "Package: ${DEB_PACKAGE_NAME}\n" in script
+ from scripts.ci.release_assets import DEB_PATTERN
+
+ assert DEB_PATTERN.fullmatch("personal-jarvis_3.0.0_amd64.deb")
+ assert DEB_PATTERN.fullmatch("dodaios_3.0.0_amd64.deb")
diff --git a/tests/unit/packaging/test_spec_console_executables.py b/tests/unit/packaging/test_spec_console_executables.py
index 59a56411cc..4a1802539f 100644
--- a/tests/unit/packaging/test_spec_console_executables.py
+++ b/tests/unit/packaging/test_spec_console_executables.py
@@ -1,8 +1,10 @@
-"""``jarvis.spec`` builds the console CLI under its name and its earlier name.
+"""``jarvis.spec`` builds the launcher and the console CLI under their names and earlier names.
-The frozen build ships three executables in one folder: the windowed launcher,
-the console command (``dodaios``) and the same console program once more as
-``jarvis``, which scripts and shell history still call. This runs the real
+The frozen build ships four executables in one folder: the windowed launcher
+(``DodaiosApp``) and the same windowed program once more as ``PersonalJarvis``,
+which taskbar pins and logon tasks of earlier releases start, the console
+command (``dodaios``) and the same console program once more as ``jarvis``,
+which scripts and shell history still call. This runs the real
spec with stand-in PyInstaller names and checks the targets it declares, for
every OS the spec is built on.
"""
@@ -107,8 +109,12 @@ def test_the_freeze_ships_the_console_program_under_both_names(
executables = [kwargs for name, _args, kwargs in calls if name == "EXE"]
built = [(kwargs["name"], kwargs["console"]) for kwargs in executables]
gui = Path(branding.WINDOWS_BRANDED_LAUNCHER_FILE_NAME).stem
+ legacy_gui = Path(branding.LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]).stem
assert built == [
(gui, False),
+ # The windowed launcher under its earlier name: pins, logon tasks and
+ # shortcuts of earlier releases start that file.
+ (legacy_gui, False),
(branding.CLI_COMMAND_NAME, True),
(branding.LEGACY_CLI_COMMAND_NAMES[0], True),
]
@@ -121,11 +127,11 @@ def test_the_freeze_ships_the_console_program_under_both_names(
collected = [item.name for item in collect if getattr(item, "target", None) == "EXE"]
assert collected == [name for name, _console in built]
- # The console builds differ in nothing but their name.
- new, legacy = executables[1], executables[2]
- assert {k: v for k, v in new.items() if k != "name"} == {
- k: v for k, v in legacy.items() if k != "name"
- }
+ # The two builds of each program differ in nothing but their name.
+ for new, legacy in ((executables[0], executables[1]), (executables[2], executables[3])):
+ assert {k: v for k, v in new.items() if k != "name"} == {
+ k: v for k, v in legacy.items() if k != "name"
+ }
def test_the_macos_bundle_still_launches_the_windowed_executable(
diff --git a/tests/unit/platform/test_permission_service_status_helpers.py b/tests/unit/platform/test_permission_service_status_helpers.py
index 5b2745aa48..736a300604 100644
--- a/tests/unit/platform/test_permission_service_status_helpers.py
+++ b/tests/unit/platform/test_permission_service_status_helpers.py
@@ -56,7 +56,7 @@ def test_app_info_of_the_installed_app(make_service) -> None:
platform="darwin",
app_name=APP_NAME,
bundle_id="com.personal-jarvis.desktop",
- bundle_path="/Applications/Personal Jarvis.app",
+ bundle_path="/Applications/Dodaios.app",
launched_as_bundle=True,
stable=True,
outside_installed_app=False,
@@ -72,6 +72,16 @@ def test_app_info_of_the_dmg_app_is_an_installed_app_too(make_service) -> None:
assert info.bundle_id == DMG_BUNDLE_ID and info.stable and not info.outside_installed_app
+def test_app_info_of_a_bundle_the_rename_has_not_reached_yet(make_service) -> None:
+ # Until the one-time rename runs, the app may still start from its earlier
+ # bundle name; it is the installed app all the same.
+ service, _tcc = make_service(bundle_path="/Applications/Personal Jarvis.app")
+
+ info = service.app_info()
+
+ assert info.stable and not info.outside_installed_app
+
+
def test_app_info_outside_the_installed_app(make_service) -> None:
service, _tcc = make_service(bundle_id=None, bundle_path=None)
@@ -254,3 +264,13 @@ def test_without_note_reset_the_open_episode_would_not_ask_again(make_service) -
assert second.asked is False
assert len(tcc.requests("microphone")) == 1
+
+
+def test_app_info_of_the_app_under_its_earlier_bundle_name(make_service) -> None:
+ # Until the one rename in place reaches it, the bundle keeps the name it
+ # was installed under; it is still the installed app.
+ service, _tcc = make_service(bundle_path="/Applications/Personal Jarvis.app")
+
+ info = service.app_info()
+
+ assert info.stable and not info.outside_installed_app
diff --git a/tests/unit/plugins/stt/test_stt_keyring_services.py b/tests/unit/plugins/stt/test_stt_keyring_services.py
new file mode 100644
index 0000000000..8cbc219c67
--- /dev/null
+++ b/tests/unit/plugins/stt/test_stt_keyring_services.py
@@ -0,0 +1,85 @@
+"""The cloud STT plugins read their key under the current and the legacy service.
+
+The plugins cannot import ``dodaios.*``, so they read the credential store
+through ``keyring`` themselves. After the service rename a key saved by an
+earlier version is still theirs; the current service wins, and reading the
+legacy one never writes there. The keyring is a fake.
+"""
+
+from __future__ import annotations
+
+from collections.abc import Iterator
+
+import keyring
+import pytest
+
+from dodaios.core import branding
+from dodaios.core.keychain_bundle import VAULT_ACCOUNT, DarwinBundleKeyringBackend
+from dodaios.plugins.stt import deepgram_api, groq_api
+from tests.fakes.fake_keychain_vault import FakePerItemKeychain, FakeSecurityCli, vault_payload
+from tests.fakes.fake_platform_keyring import FakePlatformKeyring
+
+CURRENT = branding.KEYRING_SERVICE_NAME
+LEGACY = branding.LEGACY_KEYRING_SERVICE_NAMES[0]
+PLUGINS = [
+ pytest.param(groq_api, "groq_api_key", "GROQ_API_KEY", id="groq"),
+ pytest.param(deepgram_api, "deepgram_api_key", "DEEPGRAM_API_KEY", id="deepgram"),
+]
+
+
+def platform() -> Iterator[FakePlatformKeyring]:
+ original = keyring.get_keyring()
+ fake = FakePlatformKeyring()
+ keyring.set_keyring(fake)
+ try:
+ yield fake
+ finally:
+ keyring.set_keyring(original)
+
+
[email protected](("module", "slot", "env"), PLUGINS)
+def test_a_key_saved_before_the_rename_is_found(
+ platform: FakePlatformKeyring, monkeypatch: pytest.MonkeyPatch, module, slot, env # noqa: ANN001
+) -> None:
+ monkeypatch.delenv(env, raising=False)
+ platform.entries[(LEGACY, slot)] = "legacy-key"
+
+ assert module._read_keyring_secret(slot) == "legacy-key"
+ assert platform.writes(LEGACY) == []
+
+
[email protected](("module", "slot", "env"), PLUGINS)
+def test_the_current_service_wins(
+ platform: FakePlatformKeyring, module, slot, env # noqa: ANN001
+) -> None:
+ platform.entries[(LEGACY, slot)] = "legacy-key"
+ platform.entries[(CURRENT, slot)] = "current-key"
+
+ assert module._read_keyring_secret(slot) == "current-key"
+
+
[email protected](("module", "slot", "env"), PLUGINS)
+def test_no_key_anywhere_is_an_empty_answer(
+ platform: FakePlatformKeyring, module, slot, env # noqa: ANN001
+) -> None:
+ assert module._read_keyring_secret(slot) == ""
+
+
[email protected](("module", "slot", "env"), PLUGINS)
+def test_a_legacy_read_through_the_macos_vault_writes_nothing(
+ module, slot, env # noqa: ANN001
+) -> None:
+ inner = FakePerItemKeychain()
+ cli = FakeSecurityCli()
+ inner.values[(LEGACY, slot)] = "per-item-legacy"
+ cli.items[(LEGACY, VAULT_ACCOUNT)] = vault_payload({})
+ original = keyring.get_keyring()
+ keyring.set_keyring(DarwinBundleKeyringBackend(inner, cli=cli))
+ try:
+ assert module._read_keyring_secret(slot) == "per-item-legacy"
+ finally:
+ keyring.set_keyring(original)
+
+ assert cli.writes(LEGACY) == []
+ assert inner.writes(LEGACY) == []
diff --git a/tests/unit/setup/test_cli_path.py b/tests/unit/setup/test_cli_path.py
index d8eebad133..a23167dcb3 100644
--- a/tests/unit/setup/test_cli_path.py
+++ b/tests/unit/setup/test_cli_path.py
@@ -2,10 +2,12 @@
from __future__ import annotations
+import os
from pathlib import Path
import pytest
+from dodaios.core.identity_migration import create_directory_link
from dodaios.setup import cli_path
from dodaios.setup.cli_path import (
COMMAND_NAMES,
@@ -356,3 +358,81 @@ def test_a_headless_container_gets_every_command_and_a_profile_block(
assert report.path_updated == str(home / ".profile")
assert (home / ".profile").read_text(encoding="utf-8").count(PROFILE_MARKER) == 1
assert report.needs_new_terminal is True
+
+
+# ------------------------------------------------- an install folder that moved
+def _moved_windows_install(tmp_path: Path) -> tuple[Path, Path]:
+ home = tmp_path / "home"
+ root = home / ".dodaios"
+ scripts = root / ".venv" / "Scripts"
+ scripts.mkdir(parents=True)
+ for command in COMMAND_NAMES:
+ (scripts / f"{command}.exe").write_bytes(b"launcher:" + command.encode())
+ return home, root
+
+
[email protected]("legacy_state", ["absent", "link"])
+def test_the_earlier_install_folder_is_retired_once_it_is_no_install_of_its_own(
+ tmp_path, legacy_state
+):
+ home, root = _moved_windows_install(tmp_path)
+ if legacy_state == "link":
+ create_directory_link(home / ".personal-jarvis", root)
+
+ assert cli_path.retired_install_roots(root, home=home) == [home / ".personal-jarvis"]
+
+
+def test_a_real_folder_under_the_earlier_name_is_another_install_and_stays(tmp_path):
+ home, root = _moved_windows_install(tmp_path)
+ (home / ".personal-jarvis").mkdir()
+
+ assert cli_path.retired_install_roots(root, home=home) == []
+ # Nor is an install that still lives under the earlier name its own past.
+ assert cli_path.retired_install_roots(home / ".personal-jarvis", home=home) == []
+
+
+def test_a_moved_windows_install_swaps_its_path_entry(tmp_path):
+ home, root = _moved_windows_install(tmp_path)
+ old_bin = home / ".personal-jarvis" / "bin"
+ store = FakeUserPath(rf"C:\Tools;{old_bin}", kind=2)
+
+ report = install_commands(
+ root, platform_name="win32", home=home, environ={}, store=store, which=_never_found,
+ retired_roots=cli_path.retired_install_roots(root, home=home),
+ )
+
+ assert store.value == rf"C:\Tools;{root / 'bin'}"
+ assert store.kind == 2
+ assert report.path_retired == [str(old_bin)]
+ assert report.path_updated is not None
+
+ removed = remove_commands(
+ root, platform_name="win32", home=home, store=FakeUserPath(store.value + f";{old_bin}"),
+ retired_roots=[home / ".personal-jarvis"],
+ )
+ assert len(removed) == 2
+
+
+def test_a_posix_link_through_the_earlier_folder_name_is_pointed_at_the_folder(
+ tmp_path, symlinks_available
+):
+ home = tmp_path / "home"
+ root = home / ".dodaios"
+ venv_bin = root / ".venv" / "bin"
+ venv_bin.mkdir(parents=True)
+ for command in COMMAND_NAMES:
+ (venv_bin / command).write_text("#!/bin/sh\n", encoding="utf-8")
+ (home / ".personal-jarvis").symlink_to(root, target_is_directory=True)
+ links = home / ".local" / "bin"
+ links.mkdir(parents=True)
+ old = links / "dodaios"
+ old.symlink_to(home / ".personal-jarvis" / ".venv" / "bin" / "dodaios")
+
+ report = install_commands(
+ root, platform_name="linux", home=home, environ={"PATH": str(links)},
+ which=_never_found,
+ )
+
+ assert "dodaios" in report.linked
+ # Windows reports a link target with its long-path prefix; compare the place.
+ assert os.path.samefile(os.readlink(old), venv_bin / "dodaios")
diff --git a/tests/unit/setup/test_desktop_integration.py b/tests/unit/setup/test_desktop_integration.py
index 6f1f2e5042..898805b63d 100644
--- a/tests/unit/setup/test_desktop_integration.py
+++ b/tests/unit/setup/test_desktop_integration.py
@@ -8,7 +8,16 @@ from pathlib import Path
import pytest
+from dodaios.core.branding import (
+ LAUNCHER_ENTRY_NAME,
+ LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES,
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ LEGACY_WINDOWS_SHORTCUT_FILE_NAMES,
+ LINUX_DESKTOP_ENTRY_FILE_NAME,
+ WINDOWS_SHORTCUT_FILE_NAME,
+)
from dodaios.setup import desktop_integration as di
+from tests.fakes.fake_windows_shortcuts import FakeShortcuts
def _managed_root(tmp_path: Path) -> Path:
@@ -19,6 +28,15 @@ def _managed_root(tmp_path: Path) -> Path:
return root
[email protected]("name", di.MANAGED_MARKERS)
+def test_a_checkout_marked_under_any_name_is_a_managed_install(
+ tmp_path: Path, name: str
+) -> None:
+ assert di.is_managed_install(tmp_path) is False
+ (tmp_path / name).write_text("{}\n", encoding="utf-8")
+ assert di.is_managed_install(tmp_path) is True
+
+
def test_windows_uninstall_values_are_per_user_app_metadata(tmp_path: Path) -> None:
root = _managed_root(tmp_path)
icon = tmp_path / "app.ico"
@@ -26,7 +44,8 @@ def test_windows_uninstall_values_are_per_user_app_metadata(tmp_path: Path) -> N
values = di.windows_uninstall_values(root, version="9.8.7", icon_path=icon)
- assert values["DisplayName"] == "Personal Jarvis"
+ # Only the name a person reads moved; the registry key it lives under did not.
+ assert values["DisplayName"] == LAUNCHER_ENTRY_NAME == "Dodaios"
assert values["DisplayVersion"] == "9.8.7"
assert values["InstallLocation"] == str(root)
assert str(root / "install" / "uninstall.ps1") in str(values["UninstallString"])
@@ -64,10 +83,10 @@ def test_linux_managed_install_gets_searchable_application_entry(tmp_path: Path)
assert report.ok is True
assert report.artifacts == ("applications_menu_entry",)
- entry = apps / "personal-jarvis.desktop"
+ entry = apps / "dodaios.desktop"
text = entry.read_text(encoding="utf-8")
- assert "Name=Personal Jarvis" in text
- assert "StartupWMClass=personal-jarvis" in text
+ assert "Name=Dodaios" in text
+ assert "StartupWMClass=dodaios" in text
def test_headless_linux_does_not_create_desktop_artifacts(
@@ -109,7 +128,7 @@ def test_macos_managed_install_gets_real_app_bundle(
assert report.ok is True
assert report.artifacts == ("applications_bundle",)
- assert (apps / "Personal Jarvis.app" / "Contents" / "Info.plist").is_file()
+ assert (apps / "Dodaios.app" / "Contents" / "Info.plist").is_file()
def test_macos_bundle_failure_warning_carries_recorded_reason(
@@ -164,7 +183,7 @@ def test_macos_bundle_failure_without_recorded_reason_says_unknown(
def test_linux_uninstall_removes_application_entry(tmp_path: Path) -> None:
apps = tmp_path / "applications"
apps.mkdir()
- entry = apps / "personal-jarvis.desktop"
+ entry = apps / "dodaios.desktop"
entry.write_text("[Desktop Entry]\n", encoding="utf-8")
report = di.remove_desktop_integration(
@@ -175,6 +194,64 @@ def test_linux_uninstall_removes_application_entry(tmp_path: Path) -> None:
assert not entry.exists()
+def _earlier_linux_entry(apps: Path, working_dir: Path | str, name: str | None = None) -> Path:
+ """A menu entry as an earlier release wrote it, under the earlier name."""
+ from dodaios.core.desktop_entry import escape_value
+
+ entry = apps / (name or LEGACY_LINUX_DESKTOP_ENTRY_FILE_NAMES[0])
+ entry.parent.mkdir(parents=True, exist_ok=True)
+ entry.write_text(
+ "[Desktop Entry]\nType=Application\nName=Personal Jarvis\n"
+ "Exec=/usr/bin/python3 -m jarvis.ui.web.launcher\n"
+ f"Path={escape_value(str(working_dir))}\nStartupWMClass=personal-jarvis\n",
+ encoding="utf-8",
+ )
+ return entry
+
+
+def test_linux_registration_retires_the_earlier_entry_of_this_install(tmp_path: Path) -> None:
+ from dodaios.core.config import PROJECT_ROOT
+
+ root = _managed_root(tmp_path)
+ apps = tmp_path / "applications"
+ earlier = _earlier_linux_entry(apps, PROJECT_ROOT)
+
+ report = di.ensure_desktop_integration(
+ install_dir=root, platform="linux", linux_applications_dir=apps
+ )
+
+ # The menu lists the app once, under the current name, with the window
+ # class the running window is pinned to.
+ assert report.ok is True
+ assert (apps / LINUX_DESKTOP_ENTRY_FILE_NAME).is_file()
+ assert not earlier.exists()
+
+
+def test_linux_registration_keeps_an_earlier_entry_of_another_install(tmp_path: Path) -> None:
+ root = _managed_root(tmp_path)
+ apps = tmp_path / "applications"
+ other = _earlier_linux_entry(apps, tmp_path / "another checkout")
+
+ di.ensure_desktop_integration(install_dir=root, platform="linux", linux_applications_dir=apps)
+ di.remove_desktop_integration(platform="linux", linux_applications_dir=apps)
+
+ assert other.is_file()
+
+
+def test_linux_uninstall_removes_the_earlier_entry_of_this_install(tmp_path: Path) -> None:
+ from dodaios.core.config import PROJECT_ROOT
+
+ apps = tmp_path / "applications"
+ earlier = _earlier_linux_entry(apps, PROJECT_ROOT)
+ (apps / LINUX_DESKTOP_ENTRY_FILE_NAME).write_text("[Desktop Entry]\n", encoding="utf-8")
+
+ report = di.remove_desktop_integration(platform="linux", linux_applications_dir=apps)
+
+ assert report.ok is True
+ assert not earlier.exists()
+ assert not (apps / LINUX_DESKTOP_ENTRY_FILE_NAME).exists()
+
+
@pytest.mark.skipif(sys.platform != "win32", reason="Windows registry and links only")
def test_windows_managed_install_is_visible_to_start_and_installed_apps(
tmp_path: Path,
@@ -206,17 +283,17 @@ def test_windows_managed_install_is_visible_to_start_and_installed_apps(
"installed_apps_registration",
"windows_app_identity",
}
- assert (programs / "Personal Jarvis.lnk").is_file()
+ assert (programs / WINDOWS_SHORTCUT_FILE_NAME).is_file()
# The Desktop entry is what Windows Search can actually see: the
# per-user Start Menu lives under %APPDATA%, which the content index
# excludes by default (forensic 2026-08-16 — the app was unfindable by
# name on such a box while its Start-Menu .lnk sat right there).
- assert (desktop / "Personal Jarvis.lnk").is_file()
+ assert (desktop / WINDOWS_SHORTCUT_FILE_NAME).is_file()
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey) as key:
- assert winreg.QueryValueEx(key, "DisplayName")[0] == "Personal Jarvis"
+ assert winreg.QueryValueEx(key, "DisplayName")[0] == LAUNCHER_ENTRY_NAME
assert winreg.QueryValueEx(key, "InstallLocation")[0] == str(root)
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, aumid_subkey) as key:
- assert winreg.QueryValueEx(key, "DisplayName")[0] == "Personal Jarvis"
+ assert winreg.QueryValueEx(key, "DisplayName")[0] == LAUNCHER_ENTRY_NAME
removed = di.remove_desktop_integration(
platform="win32",
@@ -226,9 +303,9 @@ def test_windows_managed_install_is_visible_to_start_and_installed_apps(
windows_aumid=aumid,
)
assert removed.ok is True
- assert not (programs / "Personal Jarvis.lnk").exists()
+ assert not (programs / WINDOWS_SHORTCUT_FILE_NAME).exists()
# An uninstall that leaves an icon on the desktop has not uninstalled.
- assert not (desktop / "Personal Jarvis.lnk").exists()
+ assert not (desktop / WINDOWS_SHORTCUT_FILE_NAME).exists()
with pytest.raises(FileNotFoundError):
winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey)
with pytest.raises(FileNotFoundError):
@@ -305,7 +382,7 @@ def test_frozen_uninstall_leaves_the_installers_artifacts_alone(
_freeze(monkeypatch, tmp_path)
apps = tmp_path / "applications"
apps.mkdir()
- entry = apps / "personal-jarvis.desktop"
+ entry = apps / "dodaios.desktop"
entry.write_text("[Desktop Entry]\n", encoding="utf-8")
bundle_plist = apps / "Personal Jarvis.app" / "Contents" / "Info.plist"
bundle_plist.parent.mkdir(parents=True)
@@ -380,3 +457,166 @@ def test_frozen_windows_build_does_not_touch_the_installers_shortcut(
assert icon_utils.ensure_desktop_shortcut(desktop_dir=desktop) is False
assert installer_lnk.read_bytes() == b"the installer's own launcher"
assert not (desktop / icon_utils.START_MENU_SHORTCUT_NAME).exists()
+
+
+# ---------------------------------------------------------------------------
+# Launchers under the product's earlier name
+# ---------------------------------------------------------------------------
+
+_OLD = LEGACY_WINDOWS_SHORTCUT_FILE_NAMES[0]
+_OLD_EXE = LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES[0]
+
+
+def _windows_layout(tmp_path: Path) -> tuple[Path, Path, Path, Path]:
+ root = _managed_root(tmp_path)
+ launch_target = root / ".venv" / "Scripts" / "DodaiosApp.exe"
+ launch_target.parent.mkdir(parents=True)
+ launch_target.write_bytes(b"MZ")
+ programs = tmp_path / "Programs"
+ desktop = tmp_path / "Desktop"
+ programs.mkdir()
+ desktop.mkdir()
+ return root, launch_target, programs, desktop
+
+
+def _shortcuts(launch_target: Path) -> FakeShortcuts:
+ return FakeShortcuts(launch_target=launch_target, shortcut_name=WINDOWS_SHORTCUT_FILE_NAME)
+
+
+def test_windows_integration_writes_the_new_launcher_and_retires_only_its_own_old_one(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ root, launch_target, programs, desktop = _windows_layout(tmp_path)
+ shortcuts = _shortcuts(launch_target)
+ shortcuts.install(monkeypatch)
+ # The Start-menu entry an earlier release wrote for THIS install, and a
+ # Desktop entry of the same name that starts another checkout.
+ own_old = shortcuts.place(programs / _OLD, root / ".venv" / "Scripts" / _OLD_EXE)
+ foreign_old = shortcuts.place(desktop / _OLD, tmp_path / "elsewhere" / "pythonw.exe")
+
+ report = di.ensure_desktop_integration(
+ install_dir=root,
+ platform="win32",
+ windows_programs_dir=programs,
+ windows_desktop_dir=desktop,
+ windows_shortcut_target_reader=shortcuts.read_target,
+ )
+
+ assert report.ok is True
+ assert (programs / WINDOWS_SHORTCUT_FILE_NAME).is_file()
+ assert (desktop / WINDOWS_SHORTCUT_FILE_NAME).is_file()
+ assert "retired_legacy_launchers" in report.artifacts
+ assert not own_old.exists()
+ assert foreign_old.exists()
+
+
+def test_an_old_launcher_stays_where_no_new_one_could_be_written(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ root, launch_target, programs, desktop = _windows_layout(tmp_path)
+ shortcuts = _shortcuts(launch_target)
+ shortcuts.install(monkeypatch)
+ from dodaios.ui import icon_utils
+
+ monkeypatch.setattr(icon_utils, "ensure_desktop_shortcut", lambda **_kw: False)
+ own_old = shortcuts.place(desktop / _OLD, root / ".venv" / "Scripts" / "pythonw.exe")
+
+ report = di.ensure_desktop_integration(
+ install_dir=root,
+ platform="win32",
+ windows_programs_dir=programs,
+ windows_desktop_dir=desktop,
+ windows_shortcut_target_reader=shortcuts.read_target,
+ )
+
+ # Never leave the user with no way to start the app.
+ assert "could not create the Desktop launcher" in report.warnings
+ assert own_old.exists()
+
+
+ ("target", "retired"),
+ [
+ ("inside-install", True),
+ ("launch-target", True),
+ ("earlier-launcher-beside-it", True),
+ ("interpreter-beside-it", True),
+ ("another-install", False),
+ ("unreadable", False),
+ ],
+)
+def test_an_old_launcher_is_retired_only_when_it_starts_this_install(
+ tmp_path: Path, target: str, retired: bool
+) -> None:
+ root = tmp_path / "install"
+ (root / ".venv").mkdir(parents=True)
+ launch_target = tmp_path / "Python311" / "DodaiosApp.exe"
+ launch_target.parent.mkdir()
+ launch_target.write_bytes(b"MZ")
+ targets = {
+ "inside-install": root / ".venv" / "pythonw.exe",
+ "launch-target": launch_target,
+ "earlier-launcher-beside-it": launch_target.with_name(_OLD_EXE),
+ "interpreter-beside-it": launch_target.with_name("pythonw.exe"),
+ "another-install": tmp_path / "install-two" / ".venv" / "pythonw.exe",
+ "unreadable": root / ".venv" / "pythonw.exe",
+ }
+ shortcuts = _shortcuts(launch_target)
+ lnk = shortcuts.place(tmp_path / "Programs" / _OLD, targets[target])
+ if target == "unreadable":
+ shortcuts.unreadable.add(lnk)
+ removed: list[Path] = []
+
+ def remove(path: Path) -> None:
+ removed.append(path)
+ path.unlink()
+
+ found, failures = di.retire_legacy_windows_launchers(
+ (lnk.parent, None),
+ install_root=root,
+ launch_target=launch_target,
+ read_target=shortcuts.read_target,
+ remove=remove,
+ )
+
+ assert failures == ()
+ assert (found == (lnk,)) is retired
+ assert lnk.exists() is not retired
+ assert removed == ([lnk] if retired else [])
+
+
+def test_the_current_launcher_is_never_taken_for_an_old_one(tmp_path: Path) -> None:
+ root = tmp_path / "install"
+ shortcuts = _shortcuts(root / "x.exe")
+ current = shortcuts.place(tmp_path / "Programs" / WINDOWS_SHORTCUT_FILE_NAME, root / "x.exe")
+
+ found, _failures = di.retire_legacy_windows_launchers(
+ (current.parent,), install_root=root, read_target=shortcuts.read_target
+ )
+
+ assert found == ()
+ assert current.exists()
+ assert shortcuts.read == []
+
+
+def test_a_windows_uninstall_retires_its_own_old_launchers_too(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ root, launch_target, programs, desktop = _windows_layout(tmp_path)
+ shortcuts = _shortcuts(launch_target)
+ own_old = shortcuts.place(programs / _OLD, root / ".venv" / "Scripts" / "pythonw.exe")
+ foreign_old = shortcuts.place(desktop / _OLD, tmp_path / "elsewhere" / "pythonw.exe")
+ monkeypatch.setattr(di, "_install_root", lambda: root)
+ # Never the real registry from a test.
+ monkeypatch.setattr(di, "_delete_windows_registry_key", lambda _subkey: True)
+
+ report = di.remove_desktop_integration(
+ platform="win32",
+ windows_programs_dir=programs,
+ windows_desktop_dir=desktop,
+ windows_shortcut_target_reader=shortcuts.read_target,
+ )
+
+ assert report.ok is True
+ assert not own_old.exists()
+ assert foreign_old.exists()
diff --git a/tests/unit/setup/test_macos_app_bundle.py b/tests/unit/setup/test_macos_app_bundle.py
index 1f4b3801fc..31fe033df3 100644
--- a/tests/unit/setup/test_macos_app_bundle.py
+++ b/tests/unit/setup/test_macos_app_bundle.py
@@ -13,6 +13,7 @@ from types import ModuleType, SimpleNamespace
import pytest
+from dodaios.core.branding import MACOS_EXECUTABLE_NAME
from dodaios.setup.macos_app_bundle import (
APP_DIR_NAME,
ensure_macos_app_bundle,
@@ -486,7 +487,7 @@ def test_build_native_bundle_layout_and_clang_invocation(
assert bundle == work / APP_DIR_NAME
info = plistlib.loads((bundle / "Contents" / "Info.plist").read_bytes())
- assert info["CFBundleExecutable"] == "PersonalJarvis"
+ assert info["CFBundleExecutable"] == MACOS_EXECUTABLE_NAME == "DodaiosApp"
assert info["CFBundleIdentifier"] == "com.personal-jarvis.desktop"
from dodaios.setup.macos_app_bundle import _BUNDLE_FORMAT_VERSION
@@ -497,7 +498,7 @@ def test_build_native_bundle_layout_and_clang_invocation(
for language in ("de", "es", "pt-PT"):
strings = bundle / "Contents" / "Resources" / f"{language}.lproj" / "InfoPlist.strings"
assert "NSMicrophoneUsageDescription" in strings.read_text(encoding="utf-8")
- executable = bundle / "Contents" / "MacOS" / "PersonalJarvis"
+ executable = bundle / "Contents" / "MacOS" / MACOS_EXECUTABLE_NAME
assert executable.read_bytes()[:4] == b"\xcf\xfa\xed\xfe"
if os.name != "nt":
assert executable.stat().st_mode & stat.S_IXUSR
diff --git a/tests/unit/setup/test_macos_app_rename.py b/tests/unit/setup/test_macos_app_rename.py
new file mode 100644
index 0000000000..bc045dd319
--- /dev/null
+++ b/tests/unit/setup/test_macos_app_rename.py
@@ -0,0 +1,302 @@
+"""The macOS app bundle takes its current name once, in place.
+
+``Personal Jarvis.app`` becomes ``Dodaios.app`` by one rename in the folder it
+lives in: the bytes, the signature and with them every privacy grant stay (TCC
+names the bundle id and the signing requirement, never a path). These tests run
+the rename over a throw-away Applications folder: only this install's bundle is
+renamed, nothing is left under the earlier name, and nothing that is not ours or
+that already has the current name is ever moved. A failed update gives the
+bundle back the name the revision it falls back to knows.
+"""
+
+from __future__ import annotations
+
+import os
+import plistlib
+import sys
+from pathlib import Path
+
+import pytest
+
+import dodaios.setup.macos_app_bundle as mab
+from dodaios.core.branding import (
+ LEGACY_MACOS_APP_DIR_NAMES,
+ MACOS_APP_DIR_NAME,
+ MACOS_BUNDLE_ID,
+ MACOS_DMG_BUNDLE_ID,
+)
+from dodaios.setup import update_rollback
+from dodaios.setup.macos_app_bundle import rename_legacy_macos_app_bundles
+
+EARLIER = LEGACY_MACOS_APP_DIR_NAMES[0]
+
+
+def _bundle(root: Path, name: str, bundle_id: str | None, marker: str = "signed-bytes") -> Path:
+ bundle = root / name
+ macos = bundle / "Contents" / "MacOS"
+ macos.mkdir(parents=True)
+ (macos / "DodaiosApp").write_text(marker, encoding="utf-8")
+ if bundle_id is not None:
+ with (bundle / "Contents" / "Info.plist").open("wb") as stream:
+ plistlib.dump({"CFBundleIdentifier": bundle_id}, stream)
+ return bundle
+
+
+def _marker(bundle: Path) -> str:
+ return (bundle / "Contents" / "MacOS" / "DodaiosApp").read_text(encoding="utf-8")
+
+
+def unregistered(monkeypatch: pytest.MonkeyPatch) -> list[Path]:
+ seen: list[Path] = []
+ monkeypatch.setattr(mab, "unregister_from_launch_services", seen.append)
+ return seen
+
+
+def roots(tmp_path: Path) -> tuple[Path, Path]:
+ system = tmp_path / "Applications"
+ user = tmp_path / "home" / "Applications"
+ system.mkdir()
+ user.mkdir(parents=True)
+ return system, user
+
+
+def test_the_names_are_what_finder_and_the_contract_show() -> None:
+ assert MACOS_APP_DIR_NAME == "Dodaios.app"
+ assert EARLIER == "Personal Jarvis.app"
+
+
+def test_our_bundle_is_renamed_byte_for_byte_with_nothing_left_behind(
+ roots, unregistered
+) -> None:
+ system, user = roots
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID)
+
+ renamed = rename_legacy_macos_app_bundles((system, user))
+
+ assert renamed == [system / MACOS_APP_DIR_NAME]
+ assert _marker(system / MACOS_APP_DIR_NAME) == "signed-bytes"
+ # No link under the earlier name: Launchpad would list the app twice.
+ assert not os.path.lexists(system / EARLIER)
+ assert sorted(p.name for p in system.iterdir()) == [MACOS_APP_DIR_NAME]
+ assert unregistered == [system / EARLIER]
+
+
+def test_a_second_run_renames_nothing(roots, unregistered) -> None:
+ system, user = roots
+ _bundle(user, EARLIER, MACOS_BUNDLE_ID)
+
+ assert rename_legacy_macos_app_bundles((system, user)) == [user / MACOS_APP_DIR_NAME]
+ assert rename_legacy_macos_app_bundles((system, user)) == []
+ assert _marker(user / MACOS_APP_DIR_NAME) == "signed-bytes"
+
+
+ "bundle_id",
+ [
+ # The .dmg app: renamed by its own updater, which swaps the bundle it
+ # runs from and must find it where it started.
+ MACOS_DMG_BUNDLE_ID,
+ "org.example.someone-else",
+ None, # no Info.plist proves nothing about ownership
+ ],
+)
+def test_only_this_installs_bundle_is_renamed(
+ roots, unregistered, bundle_id: str | None
+) -> None:
+ system, _user = roots
+ _bundle(system, EARLIER, bundle_id, marker="not ours to move")
+
+ assert rename_legacy_macos_app_bundles((system,)) == []
+ assert _marker(system / EARLIER) == "not ours to move"
+ assert not (system / MACOS_APP_DIR_NAME).exists()
+ assert unregistered == []
+
+
[email protected]("present_id", [MACOS_BUNDLE_ID, "org.example.dodaios", None])
+def test_an_app_already_under_the_current_name_keeps_both(
+ roots, unregistered, present_id: str | None
+) -> None:
+ system, _user = roots
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID, marker="earlier")
+ _bundle(system, MACOS_APP_DIR_NAME, present_id, marker="present")
+
+ assert rename_legacy_macos_app_bundles((system,)) == []
+ assert _marker(system / EARLIER) == "earlier"
+ assert _marker(system / MACOS_APP_DIR_NAME) == "present"
+
+
+def test_a_link_under_the_earlier_name_is_left_alone(roots, unregistered) -> None:
+ system, user = roots
+ real = _bundle(user, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID)
+ try:
+ (system / EARLIER).symlink_to(real, target_is_directory=True)
+ except OSError:
+ pytest.skip("this account cannot create symbolic links")
+
+ assert rename_legacy_macos_app_bundles((system,)) == []
+ assert (system / EARLIER).is_symlink()
+
+
+def test_a_failed_rename_keeps_the_working_app(
+ roots, unregistered, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ system, _user = roots
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID)
+
+ def _refuse(_source: object, _target: object) -> None:
+ raise PermissionError("Operation not permitted")
+
+ monkeypatch.setattr(mab.os, "rename", _refuse)
+
+ assert rename_legacy_macos_app_bundles((system,)) == []
+ assert _marker(system / EARLIER) == "signed-bytes"
+ assert unregistered == []
+
+
+def test_uninstall_removes_our_bundle_under_either_name(roots, unregistered) -> None:
+ system, _user = roots
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID)
+ _bundle(system, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID)
+
+ assert mab.remove_macos_app_bundle(applications_dir=system) is True
+ assert list(system.iterdir()) == []
+
+
+def test_the_dmg_app_is_found_under_its_earlier_name(
+ roots, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ system, user = roots
+ monkeypatch.setattr(mab, "SYSTEM_APPLICATIONS_DIR", system)
+ monkeypatch.setattr(mab, "user_applications_dir", lambda: user)
+ dmg_app = _bundle(system, EARLIER, MACOS_DMG_BUNDLE_ID)
+
+ assert mab.installed_macos_app_bundle_path() == dmg_app
+
+
[email protected](sys.platform == "win32", reason="patches sys.platform to darwin")
+def test_the_repair_renames_and_follows_the_running_app(
+ roots, unregistered, monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ """The process keeps the path it started from; the repair hands back, and
+ registers, the bundle under its current name and never rebuilds it."""
+ system, user = roots
+ launched_from = _bundle(system, EARLIER, MACOS_BUNDLE_ID)
+ monkeypatch.setattr(mab.sys, "platform", "darwin")
+ monkeypatch.setattr(mab, "SYSTEM_APPLICATIONS_DIR", system)
+ monkeypatch.setattr(mab, "user_applications_dir", lambda: user)
+ monkeypatch.setattr(mab, "ensure_local_signing_identity", lambda **_kw: None)
+ monkeypatch.setattr(
+ mab, "_running_managed_bundle", lambda *, install_root, **_kw: launched_from
+ )
+ monkeypatch.setattr(
+ mab,
+ "_install_native_bundle",
+ lambda *_a, **_kw: pytest.fail("a renamed running app must never be rebuilt"),
+ )
+ registered: list[Path] = []
+ monkeypatch.setattr(mab, "register_with_launch_services", registered.append)
+
+ result = mab.ensure_macos_app_bundle(install_dir=tmp_path / "install")
+
+ assert result == system / MACOS_APP_DIR_NAME
+ assert registered == [system / MACOS_APP_DIR_NAME]
+ assert not launched_from.exists()
+
+
+def test_the_repair_of_an_injected_folder_renames_there_first(
+ roots, unregistered, monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ system, _user = roots
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID)
+ seen: list[list[str]] = []
+
+ def _stop_after_the_rename(_bundle: Path) -> bool:
+ seen.append(sorted(p.name for p in system.iterdir()))
+ raise RuntimeError("stop here")
+
+ monkeypatch.setattr(mab, "_is_foreign_bundle", _stop_after_the_rename)
+
+ assert mab.ensure_macos_app_bundle(install_dir=tmp_path, applications_dir=system) is None
+ assert seen == [[MACOS_APP_DIR_NAME]]
+
+
+# --------------------------------------------------------------------------- #
+# A failed update gives the bundle back its earlier name
+# --------------------------------------------------------------------------- #
+def _git_show_answering(answers: dict[str, str | None]):
+ def _show(_root: Path, spec: str) -> str | None:
+ return answers.get(spec)
+
+ return _show
+
+
+def test_a_revision_without_a_contract_knows_the_earlier_name(tmp_path: Path) -> None:
+ show = _git_show_answering({})
+ assert update_rollback.previous_macos_app_dir_name(tmp_path, "abc", git_show=show) == EARLIER
+
+
+def test_a_revision_with_a_contract_knows_the_name_it_states(tmp_path: Path) -> None:
+ show = _git_show_answering(
+ {
+ "old:install/update-contract.json": '{"schema": 1, "macos_app_dir_name": '
+ f'"{EARLIER}"}}',
+ "new:install/update-contract.json": '{"schema": 1, "macos_app_dir_name": '
+ f'"{MACOS_APP_DIR_NAME}"}}',
+ }
+ )
+ previous = update_rollback.previous_macos_app_dir_name
+ assert previous(tmp_path, "old", git_show=show) == EARLIER
+ assert previous(tmp_path, "new", git_show=show) == MACOS_APP_DIR_NAME
+
+
+def test_the_rollback_gives_our_bundle_its_earlier_name_back(roots) -> None:
+ system, user = roots
+ _bundle(user, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID)
+
+ restored = update_rollback.restore_macos_app_bundle_name(EARLIER, (system, user))
+
+ assert restored == [user / EARLIER]
+ assert _marker(user / EARLIER) == "signed-bytes"
+ assert not os.path.lexists(user / MACOS_APP_DIR_NAME)
+
+
[email protected]("bundle_id", [MACOS_DMG_BUNDLE_ID, "org.example.dodaios", None])
+def test_the_rollback_never_renames_an_app_that_is_not_this_installs(
+ roots, bundle_id: str | None
+) -> None:
+ system, _user = roots
+ _bundle(system, MACOS_APP_DIR_NAME, bundle_id)
+
+ assert update_rollback.restore_macos_app_bundle_name(EARLIER, (system,)) == []
+ assert (system / MACOS_APP_DIR_NAME).is_dir()
+
+
+def test_the_rollback_renames_nothing_for_a_revision_that_knows_the_current_name(
+ roots,
+) -> None:
+ system, _user = roots
+ _bundle(system, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID)
+
+ restore = update_rollback.restore_macos_app_bundle_name
+ assert restore(MACOS_APP_DIR_NAME, (system,)) == []
+ # Nor to a name that was never ours.
+ assert restore("Someone Else.app", (system,)) == []
+ assert (system / MACOS_APP_DIR_NAME).is_dir()
+
+
+def test_the_rollback_never_replaces_a_bundle_under_the_earlier_name(roots) -> None:
+ system, _user = roots
+ _bundle(system, MACOS_APP_DIR_NAME, MACOS_BUNDLE_ID, marker="current")
+ _bundle(system, EARLIER, MACOS_BUNDLE_ID, marker="earlier")
+
+ assert update_rollback.restore_macos_app_bundle_name(EARLIER, (system,)) == []
+ assert _marker(system / MACOS_APP_DIR_NAME) == "current"
+ assert _marker(system / EARLIER) == "earlier"
+
+
+def test_the_rollback_hook_does_nothing_off_macos() -> None:
+ if sys.platform == "darwin":
+ pytest.skip("the darwin branch touches the real Applications folders")
+ assert update_rollback.main(["abc", "def"]) == 0
diff --git a/tests/unit/setup/test_macos_dmg_identity.py b/tests/unit/setup/test_macos_dmg_identity.py
index b5f1132071..b7299f3565 100644
--- a/tests/unit/setup/test_macos_dmg_identity.py
+++ b/tests/unit/setup/test_macos_dmg_identity.py
@@ -96,3 +96,26 @@ def test_without_any_install_the_managed_location_is_reported(roots) -> None:
assert path.name == APP_DIR_NAME
assert path.parent in {system, user}
assert not path.exists()
+
+
+def test_the_image_carries_the_app_under_its_current_name_and_its_old_id() -> None:
+ """The .dmg app took the current bundle name; its bundle id did not move,
+ so every privacy grant of an installed copy still names it."""
+ from dodaios.core.branding import MACOS_APP_DIR_NAME, MACOS_APP_NAME
+
+ spec = PYINSTALLER_SPEC.read_text(encoding="utf-8")
+ assert re.search(r'^MACOS_APP_NAME\s*=\s*"([^"]+)"', spec, re.MULTILINE).group(1) == (
+ MACOS_APP_DIR_NAME
+ )
+ assert f'"CFBundleName": "{MACOS_APP_NAME}"' in spec
+ assert f'"CFBundleDisplayName": "{MACOS_APP_NAME}"' in spec
+ assert MACOS_DMG_BUNDLE_ID == "ai.personaljarvis.desktop"
+ build = (REPO_ROOT / "packaging" / "macos" / "build.sh").read_text(encoding="utf-8")
+ assert f'\nAPP_NAME="{MACOS_APP_NAME}"\n' in build
+ # The mounted volume shows the same name as the app inside it.
+ assert f'\nVOLUME_NAME="{MACOS_APP_NAME}"\n' in build
+ workflow = (REPO_ROOT / ".github" / "workflows" / "desktop-installers.yml").read_text(
+ encoding="utf-8"
+ )
+ assert f'--app "dist/{MACOS_APP_DIR_NAME}"' in workflow
+ assert f'"$mount_point/{MACOS_APP_DIR_NAME}/Contents/MacOS/' in workflow
diff --git a/tests/unit/setup/test_macos_dock.py b/tests/unit/setup/test_macos_dock.py
index 8493f7ca61..6576c21c25 100644
--- a/tests/unit/setup/test_macos_dock.py
+++ b/tests/unit/setup/test_macos_dock.py
@@ -138,3 +138,11 @@ def test_unreadable_dock_preferences_change_nothing(
assert dock.pin_to_dock_once(_BUNDLE) is False
# Nothing was decided, so the next installer run looks again.
assert not marker.exists()
+
+
+def test_an_unresolved_tile_is_ours_under_the_current_and_the_earlier_name() -> None:
+ # The bundle was renamed in place; a tile the Dock has not resolved yet
+ # may carry either name in its URL.
+ assert dock.is_our_tile(_tile("file:///Applications/Dodaios.app/", None))
+ assert dock.is_our_tile(_tile("file:///Applications/Personal%20Jarvis.app/", None))
+ assert not dock.is_our_tile(_tile("file:///Applications/Dodaios%20Notes.app/", None))
diff --git a/tests/unit/setup/test_onboarding_meta.py b/tests/unit/setup/test_onboarding_meta.py
index b514241402..79c5c684ea 100644
--- a/tests/unit/setup/test_onboarding_meta.py
+++ b/tests/unit/setup/test_onboarding_meta.py
@@ -1,5 +1,7 @@
import sysconfig
+import pytest
+
from dodaios.setup import onboarding_meta as m
@@ -57,12 +59,14 @@ def test_canonical_terms_disclose_project_authentication_service():
_assert_authentication_disclosure(m.read_terms_text())
[email protected]("distribution", ["dodaios", "personal-jarvis"])
def test_read_terms_text_uses_installed_document_when_source_is_absent(
tmp_path,
monkeypatch,
+ distribution,
):
canonical = m.read_terms_text()
- installed = tmp_path / "share" / "personal-jarvis" / "docs" / "legal" / "TERMS.md"
+ installed = tmp_path / "share" / distribution / "docs" / "legal" / "TERMS.md"
installed.parent.mkdir(parents=True)
installed.write_text(canonical, encoding="utf-8")
monkeypatch.setattr(m, "_TERMS_PATH", tmp_path / "absent-source" / "TERMS.md")
diff --git a/tests/unit/setup/test_uninstall.py b/tests/unit/setup/test_uninstall.py
index 43b38ec652..7cfde4db61 100644
--- a/tests/unit/setup/test_uninstall.py
+++ b/tests/unit/setup/test_uninstall.py
@@ -14,6 +14,9 @@ from pathlib import Path
import pytest
+from dodaios.core import secret_slots
+from dodaios.core.identity_migration import create_directory_link, keyring_marker_key
+from dodaios.core.keychain_bundle import VAULT_ACCOUNT
from dodaios.setup import uninstall
from dodaios.setup.uninstall import UninstallPlan
@@ -79,7 +82,10 @@ def test_build_plan_reflects_real_repo(monkeypatch: pytest.MonkeyPatch) -> None:
assert plan.install_dir == Path(cfg.PROJECT_ROOT).resolve()
# The repo we run from IS a Jarvis install.
assert plan.is_jarvis_install is True
- assert plan.config_file == plan.install_dir / "jarvis.toml"
+ # jarvis.toml while the checkout has one, else dodaios.toml.
+ from dodaios.core.identity_boot import resolve_config_file
+
+ assert plan.config_file == resolve_config_file(plan.install_dir)
assert plan.data_dir == plan.install_dir / "data"
@@ -196,12 +202,16 @@ def test_bootstraps_stop_the_running_app_and_retry_the_delete() -> None:
# ---------------------------------------------------------------- key removal
+MARKER = keyring_marker_key(uninstall.cfg.LEGACY_KEYRING_SERVICES[0])
+
+
def test_remove_keys_deletes_each_present_key(monkeypatch: pytest.MonkeyPatch) -> None:
deleted: list[str] = []
monkeypatch.setattr(uninstall.cfg, "delete_secret", lambda key: (deleted.append(key) or True))
n = uninstall._remove_keys(["openai_api_key", "gemini_api_key"])
assert n == 2
- assert deleted == ["openai_api_key", "gemini_api_key"]
+ # Then the migration marker, which is bookkeeping and not a counted key.
+ assert deleted == ["openai_api_key", "gemini_api_key", MARKER]
# ------------------------------------------- macOS Keychain (prompt-free paths)
@@ -255,7 +265,8 @@ def test_macos_probe_declines_on_other_platforms(monkeypatch: pytest.MonkeyPatch
def test_macos_delete_loops_over_duplicates_and_stops(
monkeypatch: pytest.MonkeyPatch,
) -> None:
- codes = iter([0, 0, 44])
+ # Current service: two duplicates, then "not found"; legacy service: none.
+ codes = iter([0, 0, 44, 44])
calls: list[list[str]] = []
def fake_run(argv, **_kwargs): # noqa: ANN001, ANN003
@@ -266,9 +277,16 @@ def test_macos_delete_loops_over_duplicates_and_stops(
monkeypatch.setattr(uninstall.subprocess, "run", fake_run)
assert uninstall._macos_delete_keychain_items("openai_api_key") is True
- assert len(calls) == 3 # two duplicates removed, then "not found" ends the loop
+ assert len(calls) == 4 # two duplicates removed, then "not found" ends each loop
assert calls[0][:2] == ["security", "delete-generic-password"]
assert all("-w" not in argv for argv in calls)
+ services = [argv[argv.index("-s") + 1] for argv in calls]
+ assert services == [
+ uninstall.cfg.KEYRING_SERVICE,
+ uninstall.cfg.KEYRING_SERVICE,
+ uninstall.cfg.KEYRING_SERVICE,
+ *uninstall.cfg.LEGACY_KEYRING_SERVICES,
+ ]
def test_macos_delete_noop_on_other_platforms(monkeypatch: pytest.MonkeyPatch) -> None:
@@ -297,8 +315,15 @@ def test_remove_keys_deletes_keychain_item_before_shared_cleanup(
n = uninstall._remove_keys(["openai_api_key"])
assert n == 1
# The silent Keychain delete must run FIRST so delete_secret's read-back
- # verification finds nothing to decrypt (= no password dialog).
- assert order == ["security:openai_api_key", "shared:openai_api_key"]
+ # verification finds nothing to decrypt (= no password dialog). The same
+ # goes for the migration marker; the vault item of each service goes last.
+ assert order == [
+ "security:openai_api_key",
+ "shared:openai_api_key",
+ f"security:{MARKER}",
+ f"shared:{MARKER}",
+ f"security:{VAULT_ACCOUNT}",
+ ]
def test_remove_keys_counts_security_only_deletion(
@@ -328,6 +353,7 @@ def test_keyring_keys_present_darwin_never_reads_secret_values(
uninstall, "_macos_keychain_item_present", lambda key: key == target
)
monkeypatch.setattr(uninstall, "_file_fallback_copy_present", lambda key: False)
+ monkeypatch.setattr(secret_slots, "dynamic_secret_keys", frozenset)
assert uninstall._keyring_keys_present() == [target]
@@ -345,10 +371,53 @@ def test_keyring_keys_present_still_sees_file_fallback_copies(
monkeypatch.setattr(
uninstall, "_file_fallback_copy_present", lambda key: key == target
)
+ monkeypatch.setattr(secret_slots, "dynamic_secret_keys", frozenset)
assert uninstall._keyring_keys_present() == [target]
+# ------------------------------------------- both credential services
+
+
+def fake_platform(monkeypatch: pytest.MonkeyPatch, tmp_path: Path): # noqa: ANN201
+ import keyring
+
+ from tests.fakes.fake_platform_keyring import FakePlatformKeyring
+
+ monkeypatch.setattr(uninstall.sys, "platform", "linux")
+ monkeypatch.delenv("JARVIS_DATA_DIR", raising=False)
+ monkeypatch.setattr(uninstall.cfg, "DATA_DIR", tmp_path)
+ monkeypatch.setattr(uninstall.cfg, "_KEYRING_BACKEND_READY", True)
+ monkeypatch.setattr(uninstall.cfg, "_FILE_BACKEND_ACTIVE", False)
+ monkeypatch.setattr(uninstall.cfg, "_PLATFORM_KEYRING_BACKEND", None)
+ monkeypatch.setattr(secret_slots, "dynamic_secret_keys", frozenset)
+ original = keyring.get_keyring()
+ fake = FakePlatformKeyring()
+ keyring.set_keyring(fake)
+ yield fake
+ keyring.set_keyring(original)
+
+
+def test_keys_saved_under_either_service_are_found_and_removed(fake_platform) -> None: # noqa: ANN001
+ current = uninstall.cfg.KEYRING_SERVICE
+ legacy = uninstall.cfg.LEGACY_KEYRING_SERVICES[0]
+ fake_platform.entries[(legacy, "openai_api_key")] = "old"
+ fake_platform.entries[(current, "gemini_api_key")] = "new"
+ fake_platform.entries[(current, "telegram_bot_token")] = "bot" # not a wizard slot
+ fake_platform.entries[(current, MARKER)] = "1"
+ uninstall.cfg._FileCredStore().set(legacy, "zai_api_key", "file-copy")
+
+ present = uninstall._keyring_keys_present()
+
+ assert set(present) == {"openai_api_key", "gemini_api_key", "telegram_bot_token", "zai_api_key"}
+ assert MARKER not in present
+
+ assert uninstall._remove_keys(present) == 4
+ assert fake_platform.entries == {}
+ assert uninstall.cfg._FileCredStore().usernames(legacy) == ()
+
+
# ---------------------------------------------------------------- folder removal
def test_remove_folder_direct_delete(tmp_path: Path) -> None:
target = tmp_path / "install"
@@ -360,6 +429,77 @@ def test_remove_folder_direct_delete(tmp_path: Path) -> None:
assert not target.exists()
+def _moved_install(tmp_path: Path) -> tuple[Path, Path, Path]:
+ """``(home, install, link)``: ``~/.dodaios`` and the link left at its earlier name."""
+ home = tmp_path / "home"
+ install = home / ".dodaios"
+ (install / "data").mkdir(parents=True)
+ (install / "data" / "keep.txt").write_text("user data", encoding="utf-8")
+ link = home / ".personal-jarvis"
+ create_directory_link(link, install)
+ return home, install, link
+
+
+def test_the_plan_lists_the_link_an_install_folder_move_left_behind(tmp_path: Path) -> None:
+ home, install, link = _moved_install(tmp_path)
+ unrelated = home / ".elsewhere"
+ unrelated.mkdir()
+
+ assert uninstall._install_links(install, home=home) == (link,)
+ # A real folder under the earlier name is another install, not a link.
+ link_is_real = tmp_path / "other-home"
+ (link_is_real / ".personal-jarvis").mkdir(parents=True)
+ assert uninstall._install_links(install, home=link_is_real) == ()
+
+
+def test_removing_the_link_never_reaches_into_the_folder(tmp_path: Path) -> None:
+ _home, install, link = _moved_install(tmp_path)
+
+ uninstall._remove_link(link)
+
+ assert not os.path.lexists(link)
+ assert (install / "data" / "keep.txt").read_text(encoding="utf-8") == "user data"
+ # And a real folder is never taken for a link.
+ with pytest.raises(OSError, match="not a link"):
+ uninstall._remove_link(install)
+ assert install.is_dir()
+
+
+def test_remove_folder_given_a_link_removes_only_the_link(tmp_path: Path) -> None:
+ _home, install, link = _moved_install(tmp_path)
+
+ assert uninstall._remove_folder(link) is True
+
+ assert not os.path.lexists(link)
+ assert (install / "data" / "keep.txt").is_file()
+
+
+def test_uninstall_removes_the_link_first_then_the_folder(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ _home, install, link = _moved_install(tmp_path)
+ plan = UninstallPlan(
+ install_dir=install,
+ is_jarvis_install=True,
+ autostart_supported=False,
+ autostart_entry=None,
+ install_links=(link,),
+ )
+ _use_plan(monkeypatch, plan)
+ called = _record_steps(monkeypatch)
+ monkeypatch.setattr(
+ uninstall,
+ "_remove_folder",
+ lambda p: called.append(f"folder:{os.path.lexists(link)}") or True,
+ )
+
+ uninstall.run_uninstall(assume_yes=True)
+
+ # The link was gone before the folder went.
+ assert called[-1] == "folder:False"
+ assert install.is_dir()
+
+
def test_running_inside_detects_self_host() -> None:
exe_dir = Path(sys.executable).resolve().parent
assert uninstall._running_inside(exe_dir) is True
diff --git a/tests/unit/ui/test_avatar_route.py b/tests/unit/ui/test_avatar_route.py
index 0ad07bcbaa..08f90371fc 100644
--- a/tests/unit/ui/test_avatar_route.py
+++ b/tests/unit/ui/test_avatar_route.py
@@ -26,6 +26,7 @@ import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
+from dodaios.core.branding import WINDOWS_USER_DATA_DIR_NAME
from dodaios.ui.web.profile_routes import router
@@ -84,7 +85,7 @@ def test_post_replaces_previous_avatar(client: TestClient, tmp_path: Path) -> No
client.post("/api/profile/avatar", files={"file": ("b.jpg", _jpeg_bytes(), "image/jpeg")})
# Exactly one avatar file survives — no orphaned .png next to the new .jpg.
- avatar_dir = tmp_path / "Jarvis" / "data"
+ avatar_dir = tmp_path / WINDOWS_USER_DATA_DIR_NAME / "data"
survivors = sorted(p.name for p in avatar_dir.glob("profile_avatar.*"))
assert survivors == ["profile_avatar.jpg"]
diff --git a/tests/unit/ui/test_branded_launcher.py b/tests/unit/ui/test_branded_launcher.py
index 422fc6b765..44c8fdf979 100644
--- a/tests/unit/ui/test_branded_launcher.py
+++ b/tests/unit/ui/test_branded_launcher.py
@@ -4,7 +4,7 @@ The Windows taskbar button takes its icon from the executable that OWNS the
window — NOT the window/class icon, AUMID, Start-Menu shortcut, registry, or
icon cache (all verified to have no effect on the button). A bare
``pythonw.exe`` launch therefore shows the Python logo on the taskbar. The fix
-re-execs the launcher through ``PersonalJarvis.exe`` — a copy of the *base*
+re-execs the launcher through ``DodaiosApp.exe`` — a copy of the *base*
interpreter's ``pythonw`` (the real window-owner; a venv launcher only
redirects to it) carrying the mascot icon, with the venv re-attached via
``__PYVENV_LAUNCHER__``. These tests pin the contract without spawning a GUI.
@@ -18,6 +18,7 @@ from pathlib import Path
import pytest
+from dodaios.core.branding import WINDOWS_BRANDED_LAUNCHER_DIR_NAME
from dodaios.ui import icon_utils
@@ -85,7 +86,7 @@ def test_branded_candidates_prefer_the_venv_then_base_then_user_dir(
targets = targets[1:]
if icon_utils._base_pythonw_executable() is not None:
assert targets[0].parent == Path(sys.base_prefix)
- assert targets[1] == tmp_path / "PersonalJarvis" / "bin" / (
+ assert targets[1] == tmp_path / WINDOWS_BRANDED_LAUNCHER_DIR_NAME / "bin" / (
icon_utils.BRANDED_LAUNCHER_EXE_NAME
)
assert all(t.name == icon_utils.BRANDED_LAUNCHER_EXE_NAME for _s, t in candidates)
@@ -101,7 +102,7 @@ def test_no_localappdata_drops_only_the_per_user_home(
pytest.skip("no interpreter resolvable in this environment")
targets = [t for _s, t in candidates]
# Nothing may point into the (now unknown) per-user dir.
- assert all("PersonalJarvis\\bin" not in str(t) for t in targets)
+ assert all(f"{WINDOWS_BRANDED_LAUNCHER_DIR_NAME}\\bin" not in str(t) for t in targets)
if icon_utils._base_pythonw_executable() is not None:
assert any(t.parent == Path(sys.base_prefix) for t in targets)
@@ -276,3 +277,43 @@ def test_ms_store_alias_base_is_skipped_not_copied(
monkeypatch.setattr(Path, "stat", _fake_path_stat, raising=False)
assert icon_utils.ensure_branded_launcher_exe() is None
+
+
+
[email protected]("which", ["current", "earlier"])
+def test_reexec_never_rebrands_a_process_that_is_the_branded_exe(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path, which: str
+) -> None:
+ """A copy under the earlier name (a pinned button of an earlier release
+ starts it) is the branded app already: re-exec'ing it into the current
+ name would cost a second process and a boot delay on every launch."""
+ name = (
+ icon_utils.BRANDED_LAUNCHER_EXE_NAME
+ if which == "current"
+ else icon_utils.LEGACY_BRANDED_LAUNCHER_EXE_NAMES[0]
+ )
+ monkeypatch.setattr(icon_utils.sys, "platform", "win32")
+ monkeypatch.delenv(icon_utils._BRANDED_LAUNCH_ENV, raising=False)
+ monkeypatch.delenv("JARVIS_DEBUG", raising=False)
+ monkeypatch.setattr(icon_utils.sys, "_base_executable", str(tmp_path / name), raising=False)
+
+ def must_not_build() -> Path: # pragma: no cover - must never run
+ raise AssertionError("a branded process must not build another branded copy")
+
+ monkeypatch.setattr(icon_utils, "ensure_branded_launcher_exe", must_not_build)
+ assert icon_utils.maybe_reexec_through_branded_launcher([]) is None
+
+
+def test_the_branded_exe_and_its_home_carry_the_current_names() -> None:
+ from dodaios.core.branding import (
+ LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES,
+ WINDOWS_BRANDED_LAUNCHER_DIR_NAME,
+ WINDOWS_BRANDED_LAUNCHER_FILE_NAME,
+ WINDOWS_USER_DATA_DIR_NAME,
+ )
+
+ assert icon_utils.BRANDED_LAUNCHER_EXE_NAME == WINDOWS_BRANDED_LAUNCHER_FILE_NAME
+ legacy = icon_utils.LEGACY_BRANDED_LAUNCHER_EXE_NAMES
+ assert legacy == LEGACY_WINDOWS_BRANDED_LAUNCHER_FILE_NAMES
+ # The per-user home is not the data directory beside it.
+ assert WINDOWS_BRANDED_LAUNCHER_DIR_NAME.casefold() != WINDOWS_USER_DATA_DIR_NAME.casefold()
diff --git a/tests/unit/ui/test_desktop_discoverability.py b/tests/unit/ui/test_desktop_discoverability.py
index 47bfedb2db..d9a5e232d6 100644
--- a/tests/unit/ui/test_desktop_discoverability.py
+++ b/tests/unit/ui/test_desktop_discoverability.py
@@ -20,7 +20,7 @@ from dodaios.ui import icon_utils
def _entry(applications_dir: Path) -> Path:
- return applications_dir / "personal-jarvis.desktop"
+ return applications_dir / "dodaios.desktop"
def test_linux_entry_carries_search_keywords(tmp_path: Path) -> None:
diff --git a/tests/unit/ui/test_icon_identity.py b/tests/unit/ui/test_icon_identity.py
index 1d48e4eaca..54dd9f7587 100644
--- a/tests/unit/ui/test_icon_identity.py
+++ b/tests/unit/ui/test_icon_identity.py
@@ -24,7 +24,9 @@ import pytest
from dodaios.ui.icon_utils import (
APP_DISPLAY_NAME,
APP_USER_MODEL_ID,
+ LEGACY_START_MENU_SHORTCUT_NAMES,
START_MENU_SHORTCUT_NAME,
+ WINDOWS_APP_DISPLAY_NAME,
ensure_start_menu_shortcut,
project_icon_path,
register_windows_app_user_model_id,
@@ -162,8 +164,9 @@ def test_bundled_app_icon_png_exists_for_linux() -> None:
assert png.as_posix().endswith("dodaios/assets/icons/jarvis.png")
-def test_app_display_name_is_personal_jarvis() -> None:
- assert APP_DISPLAY_NAME == "Personal Jarvis"
+def test_the_linux_shell_name_is_dodaios_and_the_aumid_stays() -> None:
+ # The name the Linux app menu lists moved with the entry and its class.
+ assert APP_DISPLAY_NAME == "Dodaios"
# The grouping key itself stays the stable PascalCase AUMID.
assert APP_USER_MODEL_ID == "PersonalJarvis.PersonalJarvis"
@@ -235,9 +238,13 @@ def test_register_aumid_is_idempotent() -> None:
# ---------------------------------------------------------------------------
-def test_start_menu_shortcut_name_is_personal_jarvis() -> None:
+def test_start_menu_shortcut_name_is_dodaios() -> None:
# The .lnk *file name* (sans suffix) is what the taskbar shows as the name.
- assert START_MENU_SHORTCUT_NAME == "Personal Jarvis.lnk"
+ assert START_MENU_SHORTCUT_NAME == "Dodaios.lnk"
+ # The entry an earlier release wrote is found again to be retired.
+ assert LEGACY_START_MENU_SHORTCUT_NAMES == ("Personal Jarvis.lnk",)
+ # Toasts, the relaunch name and the shortcut description say the same.
+ assert WINDOWS_APP_DISPLAY_NAME == "Dodaios"
def test_ensure_start_menu_shortcut_noop_off_windows() -> None:
diff --git a/tests/unit/ui/test_relaunch_properties.py b/tests/unit/ui/test_relaunch_properties.py
index 3cd336b4a3..a54cef459e 100644
--- a/tests/unit/ui/test_relaunch_properties.py
+++ b/tests/unit/ui/test_relaunch_properties.py
@@ -92,7 +92,7 @@ def test_relaunch_properties_stick_on_a_real_window() -> None:
name = store.GetValue((fmtid, icon_utils._PID_RELAUNCH_NAME)).GetValue()
assert aumid == icon_utils.APP_USER_MODEL_ID
- assert name == icon_utils.APP_DISPLAY_NAME
+ assert name == icon_utils.WINDOWS_APP_DISPLAY_NAME
assert str(icon).lower().endswith(".ico,0")
finally:
try:
diff --git a/tests/unit/ui/test_relauncher.py b/tests/unit/ui/test_relauncher.py
index ffd060e51b..94944ed924 100644
--- a/tests/unit/ui/test_relauncher.py
+++ b/tests/unit/ui/test_relauncher.py
@@ -378,3 +378,54 @@ def test_restart_watchdog_exits_while_destroy_window_is_blocked():
release_destroy.set()
worker.join(timeout=0.5)
assert not worker.is_alive()
+
+
+def test_build_launch_command_still_finds_the_branded_exe_under_its_earlier_name(
+ monkeypatch, tmp_path
+):
+ # An install updated from an earlier release has only the earlier copy
+ # until the next start builds the current one; a restart must still use it.
+ from dodaios.core.instance import current_instance
+
+ (legacy_name,) = current_instance().legacy_windows_branded_launcher_file_names
+ legacy = tmp_path / legacy_name
+ legacy.write_bytes(b"MZ")
+ monkeypatch.setattr(relauncher.sys, "platform", "win32")
+ monkeypatch.setattr(relauncher.sys, "executable", str(tmp_path / "python.exe"))
+ monkeypatch.setattr(relauncher.sys, "_base_executable", "", raising=False)
+ monkeypatch.delenv("LOCALAPPDATA", raising=False)
+
+ assert relauncher.build_launch_command("python.exe")[0] == str(legacy)
+ # Once the current copy exists it wins.
+ current = tmp_path / current_instance().windows_branded_launcher_file_name
+ current.write_bytes(b"MZ")
+ assert relauncher.build_launch_command("python.exe")[0] == str(current)
+
+
+def test_the_branded_exe_is_found_in_the_earlier_per_user_folder(monkeypatch, tmp_path):
+ from dodaios.core.branding import LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES
+ from dodaios.core.instance import current_instance
+
+ (legacy_name,) = current_instance().legacy_windows_branded_launcher_file_names
+ old_home = tmp_path / LEGACY_WINDOWS_BRANDED_LAUNCHER_DIR_NAMES[0] / "bin"
+ old_home.mkdir(parents=True)
+ (old_home / legacy_name).write_bytes(b"MZ")
+ monkeypatch.setattr(relauncher.sys, "platform", "win32")
+ monkeypatch.setattr(relauncher.sys, "executable", str(tmp_path / "venv" / "python.exe"))
+ monkeypatch.setattr(relauncher.sys, "_base_executable", "", raising=False)
+ monkeypatch.setenv("LOCALAPPDATA", str(tmp_path))
+
+ assert relauncher._existing_branded_launcher() == old_home / legacy_name
+
+
+def test_the_loop_guard_is_set_for_the_branded_exe_under_its_earlier_name(
+ monkeypatch, tmp_path
+):
+ from dodaios.core.instance import current_instance
+
+ (legacy_name,) = current_instance().legacy_windows_branded_launcher_file_names
+ monkeypatch.setattr(relauncher.sys, "platform", "win32")
+ env = relauncher._apply_branded_launch_env(
+ {"PATH": "/bin"}, [str(tmp_path / legacy_name), "-m", "dodaios.ui.web.launcher"]
+ )
+ assert env["JARVIS_BRANDED_LAUNCH"] == "1"
diff --git a/tests/unit/ui/test_relauncher_update_contract.py b/tests/unit/ui/test_relauncher_update_contract.py
index 08a0b1cac8..c9c9ae386b 100644
--- a/tests/unit/ui/test_relauncher_update_contract.py
+++ b/tests/unit/ui/test_relauncher_update_contract.py
@@ -155,6 +155,29 @@ def test_admin_port_is_read_from_the_config_file_the_tree_names(
assert relauncher._restart_admin_port(tmp_path) == 40002
+def test_admin_port_is_read_from_the_first_config_file_that_exists(
+ tmp_path: Path, default_instance: None
+) -> None:
+ # A fresh install has only the current name.
+ (tmp_path / "dodaios.toml").write_text("[ui]\nadmin_api_port = 40003\n", encoding="utf-8")
+ assert relauncher._restart_admin_port(tmp_path) == 40003
+ # An existing jarvis.toml stays the configuration beside it.
+ (tmp_path / "jarvis.toml").write_text("[ui]\nadmin_api_port = 40004\n", encoding="utf-8")
+ assert relauncher._restart_admin_port(tmp_path) == 40004
+
+
+def test_the_pre_update_snapshot_saves_the_config_under_either_name(tmp_path: Path) -> None:
+ root = tmp_path / "install"
+ root.mkdir()
+ (root / "dodaios.toml").write_text("fresh\n", encoding="utf-8")
+ snapshot = relauncher.snapshot_user_state(root)
+ assert snapshot is not None
+ assert (snapshot / "dodaios.toml").read_text(encoding="utf-8") == "fresh\n"
+ (root / "jarvis.toml").write_text("kept\n", encoding="utf-8")
+ later = relauncher.snapshot_user_state(root)
+ assert later is not None and (later / "jarvis.toml").read_text(encoding="utf-8") == "kept\n"
+
+
def test_launch_command_starts_the_module_the_tree_names(
monkeypatch: pytest.MonkeyPatch, default_instance: None
) -> None:
@@ -287,10 +310,11 @@ def test_macos_restart_never_opens_another_app_for_want_of_the_right_one(
# --------------------------------------------------------------------------- #
# Rollback hook
# --------------------------------------------------------------------------- #
-def _pending(root: Path) -> tuple[str, str]:
+def _pending(root: Path, marker: str | None = relauncher.MANAGED_MARKER) -> tuple[str, str]:
previous, target = "a" * 40, "b" * 40
(root / ".git").mkdir()
- (root / relauncher.MANAGED_MARKER).write_text("{}\n", encoding="utf-8")
+ if marker is not None:
+ (root / marker).write_text("{}\n", encoding="utf-8")
(root / relauncher.PENDING_UPDATE_FILENAME).write_text(
json.dumps(
{
@@ -364,7 +388,10 @@ class _FakeCheckout:
def _finalize_with(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path, **options: object
) -> tuple[_FakeCheckout, bool, str, str]:
- previous, target = _pending(tmp_path)
+ previous, target = _pending(
+ tmp_path,
+ options.pop("marker", relauncher.MANAGED_MARKER), # type: ignore[arg-type]
+ )
checkout = _FakeCheckout(
tmp_path,
target=target,
@@ -381,6 +408,29 @@ def _finalize_with(
return checkout, ok, previous, target
[email protected]("marker", relauncher.MANAGED_MARKERS)
+def test_a_checkout_marked_under_any_name_is_updated(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path, marker: str
+) -> None:
+ # An install made before the rename and updated in-app since carries
+ # only the earlier name.
+ checkout, ok, _previous, target = _finalize_with(
+ monkeypatch, tmp_path, install_fails=False, marker=marker
+ )
+ assert ok is True
+ assert checkout.calls[0] == ["git", "reset", "--hard", target]
+
+
+def test_an_unmarked_checkout_is_never_reset(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path
+) -> None:
+ checkout, ok, _previous, _target = _finalize_with(
+ monkeypatch, tmp_path, install_fails=False, marker=None
+ )
+ assert ok is False
+ assert checkout.calls == []
+
+
def test_a_successful_update_never_runs_the_rollback_hook(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
@@ -1074,3 +1124,34 @@ def test_the_guard_notices_a_module_that_was_not_loaded_in_time(tmp_path: Path)
"dodaios.core.process_utils" in outcome["late"]
)
assert outcome["dialogs"] == []
+
+
+def test_an_updater_that_knows_only_the_earlier_bundle_name_restarts_the_renamed_app(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path, default_instance: None
+) -> None:
+ """The crossing of the bundle rename, from the side of the release before it.
+
+ That release's helper knows the bundle as ``Personal Jarvis.app``. This
+ tree's installer renamed it in place under the bundle id it always had,
+ and this tree's contract says so: the helper must open the renamed bundle.
+ """
+ import dodaios.setup.macos_app_bundle as bundle_module
+ from dodaios.core.branding import LEGACY_MACOS_APP_DIR_NAMES, MACOS_BUNDLE_ID
+
+ contract = read_update_contract(REPO)
+ assert contract.macos_app_dir_name == relauncher.MACOS_APP_DIR_NAME
+ assert contract.macos_bundle_id == MACOS_BUNDLE_ID
+ earlier = LEGACY_MACOS_APP_DIR_NAMES[0]
+ known = tmp_path / "Applications" / earlier
+ renamed = _app_bundle(known.with_name(contract.macos_app_dir_name), MACOS_BUNDLE_ID)
+ monkeypatch.setattr(relauncher, "MACOS_APP_DIR_NAME", earlier) # the older helper
+ monkeypatch.setattr(relauncher.sys, "platform", "darwin")
+ monkeypatch.setattr(relauncher.Path, "home", lambda: tmp_path / "home")
+ monkeypatch.setattr(bundle_module, "macos_app_bundle_path", lambda: known)
+
+ assert relauncher.build_launch_command("python3", contract=contract) == [
+ "/usr/bin/open",
+ "-W",
+ "-a",
+ str(renamed),
+ ]
diff --git a/tests/unit/ui/test_single_instance_mutexes.py b/tests/unit/ui/test_single_instance_mutexes.py
new file mode 100644
index 0000000000..5c4b793ec8
--- /dev/null
+++ b/tests/unit/ui/test_single_instance_mutexes.py
@@ -0,0 +1,102 @@
+"""The primary claims the single-instance mutex under every name it has had.
+
+An old and a new release must never run side by side: they would share the
+data directory, the ports and the microphone. A primary therefore holds the
+mutex under its current name and under each earlier one, and a process that
+finds ANY of them taken is a secondary. The mutexes live in an in-memory
+namespace (``tests/fakes/fake_win32_mutex.py``): a real ``Global\\`` name would
+collide with the app running on the developer's machine.
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+
+from dodaios.core.branding import LEGACY_WINDOWS_MUTEX_NAMES, WINDOWS_MUTEX_NAME
+from dodaios.ui.shell import single_instance
+from dodaios.ui.shell.single_instance import SingleInstance
+from tests.fakes.fake_win32_mutex import FakeNamedMutexes
+
+_LEGACY = LEGACY_WINDOWS_MUTEX_NAMES[0]
+
+
+def windows(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(single_instance, "_is_windows", lambda: True)
+ # The boot housekeeping a real primary runs is not under test here.
+ monkeypatch.setattr(SingleInstance, "_on_primary_claim", lambda _self: None)
+
+
+def _mutexes(monkeypatch: pytest.MonkeyPatch, *held_elsewhere: str) -> FakeNamedMutexes:
+ fake = FakeNamedMutexes(held_elsewhere=held_elsewhere)
+ fake.install(monkeypatch, single_instance)
+ return fake
+
+
+def test_the_default_instance_claims_the_current_name_and_every_earlier_one() -> None:
+ assert single_instance.MUTEX_NAMES == (WINDOWS_MUTEX_NAME, *LEGACY_WINDOWS_MUTEX_NAMES)
+ assert single_instance.MUTEX_NAMES[0] == single_instance.MUTEX_NAME
+
+
+def test_a_primary_holds_both_names_until_it_releases(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ fake = _mutexes(monkeypatch)
+
+ claim = SingleInstance(app_dir=tmp_path).try_claim()
+
+ assert claim is not None
+ assert fake.is_held(WINDOWS_MUTEX_NAME) and fake.is_held(_LEGACY)
+ claim.release()
+ assert not fake.is_held(WINDOWS_MUTEX_NAME) and not fake.is_held(_LEGACY)
+
+
+def test_a_running_primary_of_an_earlier_release_makes_this_one_secondary(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ # The earlier release holds only its own name.
+ fake = _mutexes(monkeypatch, _LEGACY)
+
+ assert SingleInstance(app_dir=tmp_path).try_claim() is None
+ # The current name this process created on the way is gone again, so it
+ # cannot block the next start once the earlier release has quit.
+ assert not fake.is_held(WINDOWS_MUTEX_NAME)
+ assert fake.held[_LEGACY] == 1
+
+
+def test_a_running_primary_of_this_release_makes_the_next_one_secondary(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ fake = _mutexes(monkeypatch)
+ first = SingleInstance(app_dir=tmp_path).try_claim()
+ assert first is not None
+
+ assert SingleInstance(app_dir=tmp_path).try_claim() is None
+ # The second process stops at the first name it finds taken, and its
+ # handle to it is closed again.
+ assert fake.created == [WINDOWS_MUTEX_NAME, _LEGACY, WINDOWS_MUTEX_NAME]
+ assert fake.held[WINDOWS_MUTEX_NAME] == 1
+ first.release()
+
+ third = SingleInstance(app_dir=tmp_path).try_claim()
+ assert third is not None
+ third.release()
+
+
+def test_an_earlier_release_starting_beside_this_primary_finds_its_name_taken(
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
+) -> None:
+ fake = _mutexes(monkeypatch)
+ claim = SingleInstance(app_dir=tmp_path).try_claim()
+ assert claim is not None
+
+ # What an earlier release does on start: create its one name and look.
+ fake.CreateMutex(None, False, _LEGACY)
+ assert fake.last_error() == 183 # ERROR_ALREADY_EXISTS
+ claim.release()
diff --git a/tests/unit/ui/test_socials_routes.py b/tests/unit/ui/test_socials_routes.py
index f12c95eda0..f668ec79e2 100644
--- a/tests/unit/ui/test_socials_routes.py
+++ b/tests/unit/ui/test_socials_routes.py
@@ -26,6 +26,8 @@ import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
+from dodaios.core.branding import WINDOWS_USER_DATA_DIR_NAME
+
DISCORD_URL = "https://discord.gg/x7USduHxbc"
REPO_URL = "https://github.com/Dodaios/Dodaios"
PROFILE_URL = "https://github.com/Dodaios"
@@ -230,5 +232,5 @@ def test_changes_persist_across_fresh_app(client: TestClient) -> None:
def test_store_file_is_written_under_data_dir(client: TestClient, tmp_path: Path) -> None:
client.get("/api/socials") # triggers seed write
- store = tmp_path / "Jarvis" / "data" / "socials.json"
+ store = tmp_path / WINDOWS_USER_DATA_DIR_NAME / "data" / "socials.json"
assert store.is_file()
diff --git a/tests/unit/ui/web/test_contacts_routes.py b/tests/unit/ui/web/test_contacts_routes.py
index e34d700047..b7b1726873 100644
--- a/tests/unit/ui/web/test_contacts_routes.py
+++ b/tests/unit/ui/web/test_contacts_routes.py
@@ -27,6 +27,8 @@ import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
+from dodaios.core.branding import WINDOWS_USER_DATA_DIR_NAME
+
@pytest.fixture(autouse=True)
def _isolate_data_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
@@ -208,7 +210,7 @@ def test_changes_persist_across_fresh_app(client: TestClient) -> None:
def test_store_file_is_written_under_data_dir(client: TestClient, tmp_path: Path) -> None:
created = _make(client, name="On Disk")
- md = tmp_path / "Jarvis" / "data" / "contacts" / f"{created['slug']}.md"
+ md = tmp_path / WINDOWS_USER_DATA_DIR_NAME / "data" / "contacts" / f"{created['slug']}.md"
assert md.is_file()
diff --git a/tests/unit/ui/web/test_permission_strings_name_the_app.py b/tests/unit/ui/web/test_permission_strings_name_the_app.py
new file mode 100644
index 0000000000..3733abbb54
--- /dev/null
+++ b/tests/unit/ui/web/test_permission_strings_name_the_app.py
@@ -0,0 +1,79 @@
+"""The permission messages name the app the way macOS lists it.
+
+A permission toast tells the user to find the app in System Settings > Privacy
+& Security, where macOS lists it under its bundle name. Every locale therefore
+spells ``MACOS_APP_NAME`` and never a name the bundle had before. The locale
+files are found by listing the directory, so a new language is covered without
+touching this test.
+"""
+
+from __future__ import annotations
+
+import json
+from collections.abc import Iterator
+from pathlib import Path
+
+import pytest
+
+from dodaios.core.branding import LEGACY_MACOS_APP_NAMES, MACOS_APP_NAME
+
+_LOCALES_DIR = (
+ Path(__file__).resolve().parents[4]
+ / "dodaios"
+ / "ui"
+ / "web"
+ / "frontend"
+ / "src"
+ / "i18n"
+ / "locales"
+)
+_LOCALE_FILES = sorted(_LOCALES_DIR.glob("*.json"))
+# The messages that name the app, as the English reference has them.
+_NAMING_KEYS = frozenset(
+ {
+ "restart_failed",
+ "toast.microphone",
+ "toast.screen_recording",
+ "toast.accessibility",
+ "toast.input_monitoring",
+ "toast.automation",
+ "toast.generic",
+ "toast.restricted",
+ "toast.restart",
+ "toast.outside",
+ "toast.wake_word",
+ }
+)
+
+
+def _strings(node: object, prefix: str = "") -> Iterator[tuple[str, str]]:
+ if isinstance(node, dict):
+ for key, value in node.items():
+ yield from _strings(value, f"{prefix}.{key}" if prefix else key)
+ elif isinstance(node, str):
+ yield prefix, node
+
+
+def _permission_strings(path: Path) -> dict[str, str]:
+ data = json.loads(path.read_text(encoding="utf-8"))
+ return dict(_strings(data.get("permissions", {})))
+
+
+def test_every_language_is_found() -> None:
+ assert {path.stem for path in _LOCALE_FILES} >= {"en", "de", "es", "pt", "zh"}
+
+
+def test_the_english_reference_names_the_app_where_expected() -> None:
+ english = _permission_strings(_LOCALES_DIR / "en.json")
+ naming = {key for key, text in english.items() if MACOS_APP_NAME in text}
+ assert naming == _NAMING_KEYS
+
+
[email protected]("path", _LOCALE_FILES, ids=lambda path: path.stem)
+def test_each_locale_names_the_app_as_macos_lists_it(path: Path) -> None:
+ strings = _permission_strings(path)
+ for key in sorted(_NAMING_KEYS):
+ assert MACOS_APP_NAME in strings.get(key, ""), f"{path.name}: permissions.{key}"
+ for key, text in strings.items():
+ for legacy in LEGACY_MACOS_APP_NAMES:
+ assert legacy not in text, f"{path.name}: permissions.{key} says {legacy!r}"
diff --git a/tests/unit/ui/web/test_permissions_snapshot.py b/tests/unit/ui/web/test_permissions_snapshot.py
index 8cef328a95..5b3051ef53 100644
--- a/tests/unit/ui/web/test_permissions_snapshot.py
+++ b/tests/unit/ui/web/test_permissions_snapshot.py
@@ -494,14 +494,25 @@ def test_the_installed_app_reports_a_stable_identity(make_env) -> None:
assert snapshot["outside_installed_app"] is False
assert snapshot["app_identity"] == {
- "app_name": "Personal Jarvis",
+ "app_name": "Dodaios",
"bundle_id": "com.personal-jarvis.desktop",
- "bundle_path": "/Applications/Personal Jarvis.app",
+ "bundle_path": "/Applications/Dodaios.app",
"launched_as_bundle": True,
"stable": True,
}
+def test_the_bundle_under_its_earlier_name_stays_a_stable_identity(make_env) -> None:
+ """Until the one-time rename reaches it, the bundle still sits at its earlier
+ path; its bundle id did not move, so it is the same installed app."""
+ snapshot = make_env(bundle_path="/Applications/Personal Jarvis.app").status()
+
+ assert snapshot["outside_installed_app"] is False
+ assert snapshot["app_identity"]["bundle_path"] == "/Applications/Personal Jarvis.app"
+ assert snapshot["app_identity"]["bundle_id"] == "com.personal-jarvis.desktop"
+ assert snapshot["app_identity"]["stable"] is True
+
+
def test_the_dmg_app_is_an_installed_app_too(make_env) -> None:
snapshot = make_env(bundle_id=DMG_BUNDLE_ID).status()
diff --git a/tests/unit/ui/web/test_setup_routes_vault_choice.py b/tests/unit/ui/web/test_setup_routes_vault_choice.py
index e74403605a..345ff6c9be 100644
--- a/tests/unit/ui/web/test_setup_routes_vault_choice.py
+++ b/tests/unit/ui/web/test_setup_routes_vault_choice.py
@@ -101,12 +101,29 @@ def test_register_existing_mode_points_vault_root_into_jarvis_subfolder(
)
assert resp.status_code == 200
body = resp.json()
- assert body["active_vault_root"] == str(user_vault / "Jarvis")
+ assert body["active_vault_root"] == str(user_vault / "Dodaios")
assert body["restart_required"] is True
- assert (user_vault / "Jarvis").is_dir() # subfolder created
+ assert (user_vault / "Dodaios").is_dir() # subfolder created
assert written # config write happened
+def test_register_existing_mode_reuses_a_folder_an_earlier_registration_made(
+ tmp_path, monkeypatch,
+):
+ """Re-registering a vault keeps the notes in the folder made under the old name."""
+ user_vault = tmp_path / "MyVault"
+ (user_vault / "Jarvis").mkdir(parents=True)
+ app = _app(tmp_path, {"vaults": {"abc123": {"path": str(user_vault)}}})
+ monkeypatch.setattr(setup_routes, "_write_vault_root_config", lambda _values: None)
+ resp = TestClient(app).post(
+ "/api/setup/obsidian/register",
+ json={"mode": "existing", "existing_vault_path": str(user_vault)},
+ )
+ assert resp.status_code == 200
+ assert resp.json()["active_vault_root"] == str(user_vault / "Jarvis")
+ assert not (user_vault / "Dodaios").exists()
+
+
def test_register_existing_mode_rejects_unknown_path(tmp_path):
app = _app(tmp_path, {"vaults": {}})
resp = TestClient(app).post(
@@ -130,7 +147,7 @@ def test_register_existing_mode_rejects_missing_path(tmp_path, monkeypatch):
)
assert resp.status_code == 200
assert resp.json()["status"] == "config_missing"
- assert not (tmp_path / "Jarvis").exists() # no folder in the server CWD
+ assert not (tmp_path / "Dodaios").exists() # no folder in the server CWD
assert not written # config was never touched
@@ -151,9 +168,9 @@ def test_register_existing_mode_dry_run_previews_without_side_effects(
assert resp.status_code == 200
body = resp.json()
assert body["status"] == "added"
- assert body["active_vault_root"] == str(user_vault / "Jarvis")
+ assert body["active_vault_root"] == str(user_vault / "Dodaios")
assert body["restart_required"] is True
- assert not (user_vault / "Jarvis").exists() # nothing created
+ assert not (user_vault / "Dodaios").exists() # nothing created
assert not written # nothing persisted
diff --git a/tests/unit/ui/web/test_shell_painted_route.py b/tests/unit/ui/web/test_shell_painted_route.py
index 79286a8594..82736dfc0e 100644
--- a/tests/unit/ui/web/test_shell_painted_route.py
+++ b/tests/unit/ui/web/test_shell_painted_route.py
@@ -56,7 +56,8 @@ async def test_shared_startup_does_not_provision_optional_browser(monkeypatch, t
"_schedule_anyio_pool_warm", "_schedule_registry_bootstraps",
"_schedule_marketplace_refresh_scheduler", "_start_local_models_health_monitor",
"_schedule_local_models_autostart", "_schedule_realtime_transport_warm",
- "_schedule_appshot_shortcut",
+ "_schedule_appshot_shortcut", "_schedule_credential_migration",
+ "_schedule_distribution_check",
):
monkeypatch.setattr(server, name, lambda **kwargs: None)
for name in (
diff --git a/tests/unit/ui/web/test_update_routes.py b/tests/unit/ui/web/test_update_routes.py
index af9c9a5ab6..6294099581 100644
--- a/tests/unit/ui/web/test_update_routes.py
+++ b/tests/unit/ui/web/test_update_routes.py
@@ -622,6 +622,23 @@ def test_pending_update_write_replaces_old_result(tmp_path: Path) -> None:
assert payload["schema"] == 1
[email protected]("name", [".dodaios-managed-install", ".jarvis-managed-install"])
+def test_the_installer_marker_counts_under_either_name(tmp_path: Path, name: str) -> None:
+ assert u._marker_path(tmp_path) is None
+ (tmp_path / name).write_text('{"profile": "headless"}\n', encoding="utf-8")
+
+ assert u._marker_path(tmp_path) == tmp_path / name
+ assert u._managed_install_profile(tmp_path) == "headless"
+
+
+def test_the_current_marker_name_is_read_first(tmp_path: Path) -> None:
+ (tmp_path / ".jarvis-managed-install").write_text('{"profile": "full"}\n', encoding="utf-8")
+ (tmp_path / ".dodaios-managed-install").write_text(
+ '{"profile": "headless"}\n', encoding="utf-8"
+ )
+ assert u._managed_install_profile(tmp_path) == "headless"
+
+
def test_legacy_marker_falls_back_to_desktop_profile(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
diff --git a/uv.lock b/uv.lock
index af4c082db6..58c649e46a 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1124,90 +1124,409 @@ wheels = [
]
[[package]]
-name = "elevenlabs"
-version = "2.53.0"
-source = { registry = "https://pypi.org/simple" }
+name = "dodaios"
+version = "3.2.0"
+source = { editable = "." }
dependencies = [
+ { name = "aiofiles" },
+ { name = "aiolimiter" },
+ { name = "aiortc", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "aiosqlite" },
+ { name = "anthropic" },
+ { name = "anyio" },
+ { name = "asyncssh", extra = ["bcrypt"] },
+ { name = "audioop-lts", marker = "python_full_version >= '3.13'" },
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
+ { name = "charset-normalizer" },
+ { name = "click" },
+ { name = "croniter" },
+ { name = "cryptography" },
+ { name = "ddgs" },
+ { name = "elevenlabs" },
+ { name = "fastapi" },
+ { name = "filelock" },
+ { name = "gitpython" },
+ { name = "google-genai" },
{ name = "httpx" },
+ { name = "jedi" },
+ { name = "jinja2" },
+ { name = "json-repair" },
+ { name = "jsonschema" },
+ { name = "keyring" },
+ { name = "loguru" },
+ { name = "markdown" },
+ { name = "mcp" },
+ { name = "num2words" },
+ { name = "numpy", version = "2.1.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
+ { name = "numpy", version = "2.3.5", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and platform_machine != 'ARM64') or (python_full_version >= '3.14' and sys_platform != 'win32') or (platform_machine == 'ARM64' and sys_platform == 'win32')" },
+ { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin'" },
+ { name = "onnxruntime", version = "1.27.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'darwin'" },
+ { name = "openai" },
+ { name = "opentelemetry-api" },
+ { name = "opentelemetry-sdk" },
+ { name = "openwakeword", marker = "(python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin') or (python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
+ { name = "packaging" },
+ { name = "pillow" },
+ { name = "platformdirs" },
+ { name = "prometheus-client" },
+ { name = "psutil" },
{ name = "pydantic" },
- { name = "pydantic-core" },
- { name = "requests" },
- { name = "typing-extensions" },
+ { name = "pydantic-settings" },
+ { name = "pyjwt" },
+ { name = "pypdf" },
+ { name = "python-telegram-bot" },
+ { name = "pyyaml" },
+ { name = "rich" },
+ { name = "scipy", version = "1.17.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
+ { name = "scipy", version = "1.18.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+ { name = "send2trash" },
+ { name = "sounddevice" },
+ { name = "structlog" },
+ { name = "tenacity" },
+ { name = "tomlkit" },
+ { name = "typer" },
+ { name = "tzdata" },
+ { name = "urllib3" },
+ { name = "uvicorn" },
+ { name = "vosk", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "watchdog", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
{ name = "websockets" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/09/a9/5f1afc8d3649b303e6a0f1c317f37062694be4dd95daec99d73581ceee54/elevenlabs-2.53.0.tar.gz", hash = "sha256:4681561f12a72baffc451f5d9d14b915dffe7e3d9b007917a1b077859bc63866", size = 646150, upload-time = "2026-06-15T09:33:10.332Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/a7/ab/56c99ee7701ab4c2c587637a32b2f9b0afbfe3373069c02ecf524f752e16/elevenlabs-2.53.0-py3-none-any.whl", hash = "sha256:c1cb3bce2134ddc42375de77d88a8154c92bef497593ece2634b23e616ef057e", size = 1752582, upload-time = "2026-06-15T09:33:08.258Z" },
-]
-[[package]]
-name = "evdev"
-version = "1.9.3"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/a5/f5/397b61091120a9ca5001041dd7bf76c385b3bfd67a0e5bcb74b852bd22a4/evdev-1.9.3.tar.gz", hash = "sha256:2c140e01ac8437758fa23fe5c871397412461f42d421aa20241dc8fe8cfccbc9", size = 32723, upload-time = "2026-02-05T21:54:24.987Z" }
-
-[[package]]
-name = "fastapi"
-version = "0.138.0"
-source = { registry = "https://pypi.org/simple" }
-dependencies = [
- { name = "annotated-doc" },
- { name = "pydantic" },
- { name = "starlette" },
- { name = "typing-extensions" },
- { name = "typing-inspection" },
+[package.optional-dependencies]
+channels = [
+ { name = "discord-py" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/5b/58/ff455d9fe47c60abadb34b9e05a304b1f05f5ab8000ac01565156b6f5e43/fastapi-0.138.0.tar.gz", hash = "sha256:d445a4877636ad191e7053e08c9bf98cb921a6756776848400bb773d1740c061", size = 419240, upload-time = "2026-06-20T01:18:05.259Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/6c/ff/8496d9847a5fedae775eb49460722d3efaa80487854273e9647ae876218c/fastapi-0.138.0-py3-none-any.whl", hash = "sha256:b6f54fd1bd72c80b0f899f172c61a600f6f7af9b43d4d772a018f35624048cb0", size = 126779, upload-time = "2026-06-20T01:18:03.483Z" },
+cuda = [
+ { name = "nvidia-cublas-cu12", marker = "sys_platform != 'darwin'" },
+ { name = "nvidia-cudnn-cu12", marker = "sys_platform != 'darwin'" },
]
-
-[[package]]
-name = "faster-whisper"
-version = "1.2.1"
-source = { registry = "https://pypi.org/simple" }
-dependencies = [
- { name = "av", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "ctranslate2", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' and sys_platform == 'darwin'" },
- { name = "onnxruntime", version = "1.27.0", source = { registry = "https://pypi.org/simple" }, marker = "(platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "tokenizers", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+desktop = [
+ { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "comtypes", marker = "sys_platform == 'win32'" },
+ { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
+ { name = "mss" },
+ { name = "ptyprocess", marker = "sys_platform != 'win32'" },
+ { name = "pyautogui" },
+ { name = "pycaw", marker = "sys_platform == 'win32'" },
+ { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
+ { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pystray" },
+ { name = "pywebview" },
+ { name = "pywin32", marker = "sys_platform == 'win32'" },
+ { name = "pywinauto", marker = "sys_platform == 'win32'" },
+ { name = "pywinpty", marker = "sys_platform == 'win32'" },
+ { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
+ { name = "tkinterdnd2" },
+ { name = "win10toast-click", marker = "sys_platform == 'win32'" },
+ { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
]
-wheels = [
- { url = "https://files.pythonhosted.org/packages/05/99/49ee85903dee060d9f08297b4a342e5e0bcfca2f027a07b4ee0a38ab13f9/faster_whisper-1.2.1-py3-none-any.whl", hash = "sha256:79a66ad50688c0b794dd501dc340a736992a6342f7f95e5811be60b5224a26a7", size = 1118909, upload-time = "2025-10-31T11:35:47.794Z" },
+desktop-linux = [
+ { name = "pynput", marker = "sys_platform == 'linux'" },
]
-
-[[package]]
-name = "filelock"
-version = "3.29.4"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/e6/dc/be6cbe99670cd6e4ad387123647cb08e0c32975e223f82551e914c5568a6/filelock-3.29.4.tar.gz", hash = "sha256:10cdb3656fc44541cdf30652a93fb10ec6b05325620eb316bd26893e4201538a", size = 63028, upload-time = "2026-06-13T16:12:00.744Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/13/37/a065dc3bd6e49423a6532c642ca7378d3f467b1ef44c2800c937af7f9739/filelock-3.29.4-py3-none-any.whl", hash = "sha256:dac1648087d5115554850d113e7dd8c83ab2d38e3435dde2d4f163847e57b767", size = 42757, upload-time = "2026-06-13T16:11:59.582Z" },
+desktop-macos = [
+ { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin'" },
]
-
-[[package]]
-name = "flatbuffers"
-version = "25.12.19"
-source = { registry = "https://pypi.org/simple" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/e8/2d/d2a548598be01649e2d46231d151a6c56d10b964d94043a335ae56ea2d92/flatbuffers-25.12.19-py2.py3-none-any.whl", hash = "sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4", size = 26661, upload-time = "2025-12-19T23:16:13.622Z" },
+dev = [
+ { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "comtypes", marker = "sys_platform == 'win32'" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
+ { name = "hypothesis" },
+ { name = "mss" },
+ { name = "mypy" },
+ { name = "ptyprocess", marker = "sys_platform != 'win32'" },
+ { name = "pyautogui" },
+ { name = "pycaw", marker = "sys_platform == 'win32'" },
+ { name = "pyinstaller" },
+ { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
+ { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pystray" },
+ { name = "pytest" },
+ { name = "pytest-asyncio" },
+ { name = "pytest-cov" },
+ { name = "pywebview" },
+ { name = "pywin32", marker = "sys_platform == 'win32'" },
+ { name = "pywinauto", marker = "sys_platform == 'win32'" },
+ { name = "pywinpty", marker = "sys_platform == 'win32'" },
+ { name = "ruff" },
+ { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
+ { name = "tkinterdnd2" },
+ { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
+ { name = "win10toast-click", marker = "sys_platform == 'win32'" },
+ { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
+]
+full = [
+ { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "comtypes", marker = "sys_platform == 'win32'" },
+ { name = "discord-py" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
+ { name = "mss" },
+ { name = "ptyprocess", marker = "sys_platform != 'win32'" },
+ { name = "pyautogui" },
+ { name = "pycaw", marker = "sys_platform == 'win32'" },
+ { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
+ { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" },
+ { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin'" },
+ { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
+ { name = "pystray" },
+ { name = "pywebview" },
+ { name = "pywin32", marker = "sys_platform == 'win32'" },
+ { name = "pywinauto", marker = "sys_platform == 'win32'" },
+ { name = "pywinpty", marker = "sys_platform == 'win32'" },
+ { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
+ { name = "tkinterdnd2" },
+ { name = "twilio" },
+ { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
+ { name = "win10toast-click", marker = "sys_platform == 'win32'" },
+ { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
+ { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
+]
+local-voice = [
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
+ { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
+]
+telephony = [
+ { name = "twilio" },
+]
+trigger-streams = [
+ { name = "aio-pika" },
+ { name = "aiokafka" },
+ { name = "paho-mqtt" },
+ { name = "redis" },
+]
+tts-eval = [
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
]
-[[package]]
-name = "frozenlist"
-version = "1.8.0"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/bc/03/077f869d540370db12165c0aa51640a873fb661d8b315d1d4d67b284d7ac/frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84", size = 86912, upload-time = "2025-10-06T05:35:45.98Z" },
- { url = "https://files.pythonhosted.org/packages/df/b5/7610b6bd13e4ae77b96ba85abea1c8cb249683217ef09ac9e0ae93f25a91/frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9", size = 50046, upload-time = "2025-10-06T05:35:47.009Z" },
- { url = "https://files.pythonhosted.org/packages/6e/ef/0e8f1fe32f8a53dd26bdd1f9347efe0778b0fddf62789ea683f4cc7d787d/frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93", size = 50119, upload-time = "2025-10-06T05:35:48.38Z" },
- { url = "https://files.pythonhosted.org/packages/11/b1/71a477adc7c36e5fb628245dfbdea2166feae310757dea848d02bd0689fd/frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f", size = 231067, upload-time = "2025-10-06T05:35:49.97Z" },
- { url = "https://files.pythonhosted.org/packages/45/7e/afe40eca3a2dc19b9904c0f5d7edfe82b5304cb831391edec0ac04af94c2/frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695", size = 233160, upload-time = "2025-10-06T05:35:51.729Z" },
- { url = "https://files.pythonhosted.org/packages/a6/aa/7416eac95603ce428679d273255ffc7c998d4132cfae200103f164b108aa/frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52", size = 228544, upload-time = "2025-10-06T05:35:53.246Z" },
+[package.metadata]
+requires-dist = [
+ { name = "aio-pika", marker = "extra == 'trigger-streams'", specifier = ">=9,<10" },
+ { name = "aiofiles", specifier = ">=24.1" },
+ { name = "aiokafka", marker = "extra == 'trigger-streams'", specifier = ">=0.12,<1" },
+ { name = "aiolimiter", specifier = ">=1.1" },
+ { name = "aiortc", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'", specifier = ">=1.13" },
+ { name = "aiosqlite", specifier = ">=0.21" },
+ { name = "anthropic", specifier = ">=0.96" },
+ { name = "anyio", specifier = ">=4.14.2" },
+ { name = "asyncssh", extras = ["bcrypt"], specifier = ">=2.24.0" },
+ { name = "audioop-lts", marker = "python_full_version >= '3.13'" },
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'", specifier = "==15.1.0" },
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin' and extra == 'local-voice'", specifier = "==15.1.0" },
+ { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin' and extra == 'tts-eval'", specifier = "==15.1.0" },
+ { name = "av", marker = "(platform_machine != 'ARM64' and extra == 'desktop') or (sys_platform != 'win32' and extra == 'desktop')", specifier = ">=14" },
+ { name = "charset-normalizer", specifier = ">=3.4" },
+ { name = "click", specifier = ">=8.1" },
+ { name = "comtypes", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=1.2" },
+ { name = "croniter", specifier = ">=6.0" },
+ { name = "cryptography", specifier = ">=50.0.2", index = "https://dodaios.github.io/Dodaios/native-crypto/50.0.2-1/simple/" },
+ { name = "ddgs", specifier = "==9.14.3" },
+ { name = "discord-py", marker = "extra == 'channels'", specifier = ">=2,<3" },
+ { name = "dodaios", extras = ["desktop", "desktop-macos", "telephony", "channels", "local-voice"], marker = "extra == 'full'" },
+ { name = "dodaios", extras = ["desktop", "local-voice"], marker = "extra == 'dev'" },
+ { name = "elevenlabs", specifier = ">=1.5" },
+ { name = "fastapi", specifier = ">=0.115" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin' and extra == 'local-voice') or (platform_machine != 'ARM64' and sys_platform == 'win32' and extra == 'local-voice') or (sys_platform != 'darwin' and sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=1.0" },
+ { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin' and extra == 'tts-eval') or (platform_machine != 'ARM64' and sys_platform == 'win32' and extra == 'tts-eval') or (sys_platform != 'darwin' and sys_platform != 'win32' and extra == 'tts-eval')", specifier = ">=1.0" },
+ { name = "filelock", specifier = ">=3.16" },
+ { name = "gitpython", specifier = ">=3.1.60" },
+ { name = "global-hotkeys", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.1.7" },
+ { name = "google-genai", specifier = ">=1.0" },
+ { name = "httpx", specifier = ">=0.27" },
+ { name = "hypothesis", marker = "extra == 'dev'", specifier = ">=6.100" },
+ { name = "jedi", specifier = ">=0.19" },
+ { name = "jinja2", specifier = ">=3.1" },
+ { name = "json-repair", specifier = ">=0.30" },
+ { name = "jsonschema", specifier = ">=4.23" },
+ { name = "keyring", specifier = ">=25.5" },
+ { name = "loguru", specifier = ">=0.7" },
+ { name = "markdown", specifier = ">=3.5" },
+ { name = "mcp", specifier = ">=1.28.1,<2" },
+ { name = "mss", marker = "extra == 'desktop'", specifier = ">=10.0" },
+ { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.13" },
+ { name = "num2words", specifier = ">=0.5.13" },
+ { name = "numpy", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')", specifier = ">=1.26,<2.2" },
+ { name = "numpy", marker = "(python_full_version >= '3.14' and platform_machine != 'ARM64') or (python_full_version >= '3.14' and sys_platform != 'win32') or (platform_machine == 'ARM64' and sys_platform == 'win32')", specifier = ">=2.3.5,<2.4" },
+ { name = "nvidia-cublas-cu12", marker = "sys_platform != 'darwin' and extra == 'cuda'", specifier = ">=12.4,<13" },
+ { name = "nvidia-cudnn-cu12", marker = "sys_platform != 'darwin' and extra == 'cuda'", specifier = ">=9,<10" },
+ { name = "onnxruntime", marker = "sys_platform != 'darwin'", specifier = ">=1.17" },
+ { name = "onnxruntime", marker = "python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin'", specifier = ">=1.17,<1.24" },
+ { name = "openai", specifier = ">=1.30" },
+ { name = "opentelemetry-api", specifier = ">=1.28" },
+ { name = "opentelemetry-sdk", specifier = ">=1.28" },
+ { name = "openwakeword", marker = "(python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin') or (sys_platform != 'darwin' and sys_platform != 'linux')", specifier = ">=0.6" },
+ { name = "openwakeword", marker = "python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux'", specifier = ">=0.6" },
+ { name = "packaging", specifier = ">=24.0" },
+ { name = "paho-mqtt", marker = "extra == 'trigger-streams'", specifier = ">=2.1,<3" },
+ { name = "pillow", specifier = ">=12.3.0" },
+ { name = "platformdirs", specifier = ">=4" },
+ { name = "prometheus-client", specifier = ">=0.21" },
+ { name = "psutil", specifier = ">=6.1" },
+ { name = "ptyprocess", marker = "sys_platform != 'win32' and extra == 'desktop'", specifier = ">=0.7" },
+ { name = "pyautogui", marker = "extra == 'desktop'", specifier = ">=0.9.54" },
+ { name = "pycaw", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=20240210" },
+ { name = "pydantic", specifier = ">=2.9,<3.0" },
+ { name = "pydantic-settings", specifier = ">=2.6" },
+ { name = "pyinstaller", marker = "extra == 'dev'", specifier = ">=6.11" },
+ { name = "pyjwt", specifier = ">=2.14.0" },
+ { name = "pynput", marker = "(sys_platform == 'darwin' and extra == 'desktop') or (sys_platform == 'win32' and extra == 'desktop')", specifier = ">=1.7" },
+ { name = "pynput", marker = "sys_platform == 'linux' and extra == 'desktop-linux'", specifier = ">=1.7" },
+ { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
+ { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
+ { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
+ { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
+ { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
+ { name = "pypdf", specifier = ">=6.16.1" },
+ { name = "pyside6-addons", marker = "(platform_machine != 'aarch64' and extra == 'desktop') or (sys_platform != 'linux' and extra == 'desktop')", specifier = ">=6.7" },
+ { name = "pyside6-essentials", marker = "(platform_machine != 'aarch64' and extra == 'desktop') or (sys_platform != 'linux' and extra == 'desktop')", specifier = ">=6.7" },
+ { name = "pystray", marker = "extra == 'desktop'", specifier = ">=0.19" },
+ { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.3" },
+ { name = "pytest-asyncio", marker = "extra == 'dev'", specifier = ">=0.24" },
+ { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=6.0" },
+ { name = "python-telegram-bot", specifier = ">=22,<23" },
+ { name = "pywebview", marker = "extra == 'desktop'", specifier = ">=5.3" },
+ { name = "pywin32", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=308" },
+ { name = "pywinauto", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.6.9" },
+ { name = "pywinpty", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=2.0" },
+ { name = "pyyaml", specifier = ">=6.0" },
+ { name = "redis", marker = "extra == 'trigger-streams'", specifier = ">=5,<9" },
+ { name = "rich", specifier = ">=13.9" },
+ { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.7" },
+ { name = "scipy", specifier = ">=1.14" },
+ { name = "send2trash", specifier = ">=1.8.3" },
+ { name = "sherpa-onnx", marker = "(platform_machine != 'ARM64' and extra == 'local-voice') or (sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=1.13.3" },
+ { name = "soundcard", marker = "(sys_platform == 'linux' and extra == 'desktop') or (sys_platform == 'win32' and extra == 'desktop')", specifier = ">=0.4.6" },
+ { name = "sounddevice", specifier = ">=0.5" },
+ { name = "structlog", specifier = ">=24.4" },
+ { name = "tenacity", specifier = ">=9.0" },
+ { name = "tkinterdnd2", marker = "extra == 'desktop'", specifier = "==0.4.2" },
+ { name = "tomlkit", specifier = ">=0.12" },
+ { name = "twilio", marker = "extra == 'telephony'", specifier = ">=8.0" },
+ { name = "typer", specifier = ">=0.12" },
+ { name = "tzdata", specifier = ">=2025.2" },
+ { name = "urllib3", specifier = ">=2.8.0" },
+ { name = "uvicorn", specifier = ">=0.32" },
+ { name = "vosk", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'", specifier = ">=0.3.44,<0.3.45" },
+ { name = "watchdog", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')", specifier = ">=5.0" },
+ { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64' and extra == 'local-voice') or (python_full_version < '3.14' and sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=2.0" },
+ { name = "websockets", specifier = ">=13" },
+ { name = "win10toast-click", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.1.2" },
+ { name = "winrt-runtime", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
+ { name = "winrt-windows-foundation", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
+ { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
+ { name = "winrt-windows-media-control", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
+]
+provides-extras = ["trigger-streams", "dev", "full", "telephony", "channels", "desktop", "desktop-linux", "desktop-macos", "local-voice", "cuda", "tts-eval"]
+
+[[package]]
+name = "elevenlabs"
+version = "2.53.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "httpx" },
+ { name = "pydantic" },
+ { name = "pydantic-core" },
+ { name = "requests" },
+ { name = "typing-extensions" },
+ { name = "websockets" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/09/a9/5f1afc8d3649b303e6a0f1c317f37062694be4dd95daec99d73581ceee54/elevenlabs-2.53.0.tar.gz", hash = "sha256:4681561f12a72baffc451f5d9d14b915dffe7e3d9b007917a1b077859bc63866", size = 646150, upload-time = "2026-06-15T09:33:10.332Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/a7/ab/56c99ee7701ab4c2c587637a32b2f9b0afbfe3373069c02ecf524f752e16/elevenlabs-2.53.0-py3-none-any.whl", hash = "sha256:c1cb3bce2134ddc42375de77d88a8154c92bef497593ece2634b23e616ef057e", size = 1752582, upload-time = "2026-06-15T09:33:08.258Z" },
+]
+
+[[package]]
+name = "evdev"
+version = "1.9.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/a5/f5/397b61091120a9ca5001041dd7bf76c385b3bfd67a0e5bcb74b852bd22a4/evdev-1.9.3.tar.gz", hash = "sha256:2c140e01ac8437758fa23fe5c871397412461f42d421aa20241dc8fe8cfccbc9", size = 32723, upload-time = "2026-02-05T21:54:24.987Z" }
+
+[[package]]
+name = "fastapi"
+version = "0.138.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "annotated-doc" },
+ { name = "pydantic" },
+ { name = "starlette" },
+ { name = "typing-extensions" },
+ { name = "typing-inspection" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/5b/58/ff455d9fe47c60abadb34b9e05a304b1f05f5ab8000ac01565156b6f5e43/fastapi-0.138.0.tar.gz", hash = "sha256:d445a4877636ad191e7053e08c9bf98cb921a6756776848400bb773d1740c061", size = 419240, upload-time = "2026-06-20T01:18:05.259Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/6c/ff/8496d9847a5fedae775eb49460722d3efaa80487854273e9647ae876218c/fastapi-0.138.0-py3-none-any.whl", hash = "sha256:b6f54fd1bd72c80b0f899f172c61a600f6f7af9b43d4d772a018f35624048cb0", size = 126779, upload-time = "2026-06-20T01:18:03.483Z" },
+]
+
+[[package]]
+name = "faster-whisper"
+version = "1.2.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "av", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "ctranslate2", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "huggingface-hub", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' and sys_platform == 'darwin'" },
+ { name = "onnxruntime", version = "1.27.0", source = { registry = "https://pypi.org/simple" }, marker = "(platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "tokenizers", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+ { name = "tqdm", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
+]
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/05/99/49ee85903dee060d9f08297b4a342e5e0bcfca2f027a07b4ee0a38ab13f9/faster_whisper-1.2.1-py3-none-any.whl", hash = "sha256:79a66ad50688c0b794dd501dc340a736992a6342f7f95e5811be60b5224a26a7", size = 1118909, upload-time = "2025-10-31T11:35:47.794Z" },
+]
+
+[[package]]
+name = "filelock"
+version = "3.29.4"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/e6/dc/be6cbe99670cd6e4ad387123647cb08e0c32975e223f82551e914c5568a6/filelock-3.29.4.tar.gz", hash = "sha256:10cdb3656fc44541cdf30652a93fb10ec6b05325620eb316bd26893e4201538a", size = 63028, upload-time = "2026-06-13T16:12:00.744Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/13/37/a065dc3bd6e49423a6532c642ca7378d3f467b1ef44c2800c937af7f9739/filelock-3.29.4-py3-none-any.whl", hash = "sha256:dac1648087d5115554850d113e7dd8c83ab2d38e3435dde2d4f163847e57b767", size = 42757, upload-time = "2026-06-13T16:11:59.582Z" },
+]
+
+[[package]]
+name = "flatbuffers"
+version = "25.12.19"
+source = { registry = "https://pypi.org/simple" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e8/2d/d2a548598be01649e2d46231d151a6c56d10b964d94043a335ae56ea2d92/flatbuffers-25.12.19-py2.py3-none-any.whl", hash = "sha256:7634f50c427838bb021c2d66a3d1168e9d199b0607e6329399f04846d42e20b4", size = 26661, upload-time = "2025-12-19T23:16:13.622Z" },
+]
+
+[[package]]
+name = "frozenlist"
+version = "1.8.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/bc/03/077f869d540370db12165c0aa51640a873fb661d8b315d1d4d67b284d7ac/frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84", size = 86912, upload-time = "2025-10-06T05:35:45.98Z" },
+ { url = "https://files.pythonhosted.org/packages/df/b5/7610b6bd13e4ae77b96ba85abea1c8cb249683217ef09ac9e0ae93f25a91/frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9", size = 50046, upload-time = "2025-10-06T05:35:47.009Z" },
+ { url = "https://files.pythonhosted.org/packages/6e/ef/0e8f1fe32f8a53dd26bdd1f9347efe0778b0fddf62789ea683f4cc7d787d/frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93", size = 50119, upload-time = "2025-10-06T05:35:48.38Z" },
+ { url = "https://files.pythonhosted.org/packages/11/b1/71a477adc7c36e5fb628245dfbdea2166feae310757dea848d02bd0689fd/frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f", size = 231067, upload-time = "2025-10-06T05:35:49.97Z" },
+ { url = "https://files.pythonhosted.org/packages/45/7e/afe40eca3a2dc19b9904c0f5d7edfe82b5304cb831391edec0ac04af94c2/frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695", size = 233160, upload-time = "2025-10-06T05:35:51.729Z" },
+ { url = "https://files.pythonhosted.org/packages/a6/aa/7416eac95603ce428679d273255ffc7c998d4132cfae200103f164b108aa/frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52", size = 228544, upload-time = "2025-10-06T05:35:53.246Z" },
{ url = "https://files.pythonhosted.org/packages/8b/3d/2a2d1f683d55ac7e3875e4263d28410063e738384d3adc294f5ff3d7105e/frozenlist-1.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:edee74874ce20a373d62dc28b0b18b93f645633c2943fd90ee9d898550770581", size = 243797, upload-time = "2025-10-06T05:35:54.497Z" },
{ url = "https://files.pythonhosted.org/packages/78/1e/2d5565b589e580c296d3bb54da08d206e797d941a83a6fdea42af23be79c/frozenlist-1.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c9a63152fe95756b85f31186bddf42e4c02c6321207fd6601a1c89ebac4fe567", size = 247923, upload-time = "2025-10-06T05:35:55.861Z" },
{ url = "https://files.pythonhosted.org/packages/aa/c3/65872fcf1d326a7f101ad4d86285c403c87be7d832b7470b77f6d2ed5ddc/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6db2185db9be0a04fecf2f241c70b63b1a242e2805be291855078f2b404dd6b", size = 230886, upload-time = "2025-10-06T05:35:57.399Z" },
@@ -2820,325 +3139,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/54/16/12b82f791c7f50ddec566873d5bdd245baa1491bac11d15ffb98aecc8f8b/pefile-2024.8.26-py3-none-any.whl", hash = "sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f", size = 74766, upload-time = "2024-08-26T21:01:02.632Z" },
]
-[[package]]
-name = "personal-jarvis"
-version = "3.2.0"
-source = { editable = "." }
-dependencies = [
- { name = "aiofiles" },
- { name = "aiolimiter" },
- { name = "aiortc", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "aiosqlite" },
- { name = "anthropic" },
- { name = "anyio" },
- { name = "asyncssh", extra = ["bcrypt"] },
- { name = "audioop-lts", marker = "python_full_version >= '3.13'" },
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
- { name = "charset-normalizer" },
- { name = "click" },
- { name = "croniter" },
- { name = "cryptography" },
- { name = "ddgs" },
- { name = "elevenlabs" },
- { name = "fastapi" },
- { name = "filelock" },
- { name = "gitpython" },
- { name = "google-genai" },
- { name = "httpx" },
- { name = "jedi" },
- { name = "jinja2" },
- { name = "json-repair" },
- { name = "jsonschema" },
- { name = "keyring" },
- { name = "loguru" },
- { name = "markdown" },
- { name = "mcp" },
- { name = "num2words" },
- { name = "numpy", version = "2.1.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
- { name = "numpy", version = "2.3.5", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.14' and platform_machine != 'ARM64') or (python_full_version >= '3.14' and sys_platform != 'win32') or (platform_machine == 'ARM64' and sys_platform == 'win32')" },
- { name = "onnxruntime", version = "1.23.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin'" },
- { name = "onnxruntime", version = "1.27.0", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'darwin'" },
- { name = "openai" },
- { name = "opentelemetry-api" },
- { name = "opentelemetry-sdk" },
- { name = "openwakeword", marker = "(python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin') or (python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
- { name = "packaging" },
- { name = "pillow" },
- { name = "platformdirs" },
- { name = "prometheus-client" },
- { name = "psutil" },
- { name = "pydantic" },
- { name = "pydantic-settings" },
- { name = "pyjwt" },
- { name = "pypdf" },
- { name = "python-telegram-bot" },
- { name = "pyyaml" },
- { name = "rich" },
- { name = "scipy", version = "1.17.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" },
- { name = "scipy", version = "1.18.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
- { name = "send2trash" },
- { name = "sounddevice" },
- { name = "structlog" },
- { name = "tenacity" },
- { name = "tomlkit" },
- { name = "typer" },
- { name = "tzdata" },
- { name = "urllib3" },
- { name = "uvicorn" },
- { name = "vosk", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "watchdog", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "websockets" },
-]
-
-[package.optional-dependencies]
-channels = [
- { name = "discord-py" },
-]
-cuda = [
- { name = "nvidia-cublas-cu12", marker = "sys_platform != 'darwin'" },
- { name = "nvidia-cudnn-cu12", marker = "sys_platform != 'darwin'" },
-]
-desktop = [
- { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "comtypes", marker = "sys_platform == 'win32'" },
- { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
- { name = "mss" },
- { name = "ptyprocess", marker = "sys_platform != 'win32'" },
- { name = "pyautogui" },
- { name = "pycaw", marker = "sys_platform == 'win32'" },
- { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
- { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pystray" },
- { name = "pywebview" },
- { name = "pywin32", marker = "sys_platform == 'win32'" },
- { name = "pywinauto", marker = "sys_platform == 'win32'" },
- { name = "pywinpty", marker = "sys_platform == 'win32'" },
- { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
- { name = "tkinterdnd2" },
- { name = "win10toast-click", marker = "sys_platform == 'win32'" },
- { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
-]
-desktop-linux = [
- { name = "pynput", marker = "sys_platform == 'linux'" },
-]
-desktop-macos = [
- { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin'" },
-]
-dev = [
- { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "comtypes", marker = "sys_platform == 'win32'" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
- { name = "hypothesis" },
- { name = "mss" },
- { name = "mypy" },
- { name = "ptyprocess", marker = "sys_platform != 'win32'" },
- { name = "pyautogui" },
- { name = "pycaw", marker = "sys_platform == 'win32'" },
- { name = "pyinstaller" },
- { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
- { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pystray" },
- { name = "pytest" },
- { name = "pytest-asyncio" },
- { name = "pytest-cov" },
- { name = "pywebview" },
- { name = "pywin32", marker = "sys_platform == 'win32'" },
- { name = "pywinauto", marker = "sys_platform == 'win32'" },
- { name = "pywinpty", marker = "sys_platform == 'win32'" },
- { name = "ruff" },
- { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
- { name = "tkinterdnd2" },
- { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
- { name = "win10toast-click", marker = "sys_platform == 'win32'" },
- { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
-]
-full = [
- { name = "av", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "comtypes", marker = "sys_platform == 'win32'" },
- { name = "discord-py" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "global-hotkeys", marker = "sys_platform == 'win32'" },
- { name = "mss" },
- { name = "ptyprocess", marker = "sys_platform != 'win32'" },
- { name = "pyautogui" },
- { name = "pycaw", marker = "sys_platform == 'win32'" },
- { name = "pynput", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
- { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" },
- { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin'" },
- { name = "pyside6-addons", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pyside6-essentials", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
- { name = "pystray" },
- { name = "pywebview" },
- { name = "pywin32", marker = "sys_platform == 'win32'" },
- { name = "pywinauto", marker = "sys_platform == 'win32'" },
- { name = "pywinpty", marker = "sys_platform == 'win32'" },
- { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "soundcard", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
- { name = "tkinterdnd2" },
- { name = "twilio" },
- { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
- { name = "win10toast-click", marker = "sys_platform == 'win32'" },
- { name = "winrt-runtime", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" },
- { name = "winrt-windows-media-control", marker = "sys_platform == 'win32'" },
-]
-local-voice = [
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
- { name = "sherpa-onnx", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'" },
- { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')" },
-]
-telephony = [
- { name = "twilio" },
-]
-trigger-streams = [
- { name = "aio-pika" },
- { name = "aiokafka" },
- { name = "paho-mqtt" },
- { name = "redis" },
-]
-tts-eval = [
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')" },
-]
-
-[package.metadata]
-requires-dist = [
- { name = "aio-pika", marker = "extra == 'trigger-streams'", specifier = ">=9,<10" },
- { name = "aiofiles", specifier = ">=24.1" },
- { name = "aiokafka", marker = "extra == 'trigger-streams'", specifier = ">=0.12,<1" },
- { name = "aiolimiter", specifier = ">=1.1" },
- { name = "aiortc", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'", specifier = ">=1.13" },
- { name = "aiosqlite", specifier = ">=0.21" },
- { name = "anthropic", specifier = ">=0.96" },
- { name = "anyio", specifier = ">=4.14.2" },
- { name = "asyncssh", extras = ["bcrypt"], specifier = ">=2.24.0" },
- { name = "audioop-lts", marker = "python_full_version >= '3.13'" },
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'", specifier = "==15.1.0" },
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin' and extra == 'local-voice'", specifier = "==15.1.0" },
- { name = "av", marker = "platform_machine == 'arm64' and sys_platform == 'darwin' and extra == 'tts-eval'", specifier = "==15.1.0" },
- { name = "av", marker = "(platform_machine != 'ARM64' and extra == 'desktop') or (sys_platform != 'win32' and extra == 'desktop')", specifier = ">=14" },
- { name = "charset-normalizer", specifier = ">=3.4" },
- { name = "click", specifier = ">=8.1" },
- { name = "comtypes", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=1.2" },
- { name = "croniter", specifier = ">=6.0" },
- { name = "cryptography", specifier = ">=50.0.2", index = "https://dodaios.github.io/Dodaios/native-crypto/50.0.2-1/simple/" },
- { name = "ddgs", specifier = "==9.14.3" },
- { name = "discord-py", marker = "extra == 'channels'", specifier = ">=2,<3" },
- { name = "elevenlabs", specifier = ">=1.5" },
- { name = "fastapi", specifier = ">=0.115" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin' and extra == 'local-voice') or (platform_machine != 'ARM64' and sys_platform == 'win32' and extra == 'local-voice') or (sys_platform != 'darwin' and sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=1.0" },
- { name = "faster-whisper", marker = "(python_full_version < '3.14' and sys_platform == 'darwin' and extra == 'tts-eval') or (platform_machine != 'ARM64' and sys_platform == 'win32' and extra == 'tts-eval') or (sys_platform != 'darwin' and sys_platform != 'win32' and extra == 'tts-eval')", specifier = ">=1.0" },
- { name = "filelock", specifier = ">=3.16" },
- { name = "gitpython", specifier = ">=3.1.60" },
- { name = "global-hotkeys", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.1.7" },
- { name = "google-genai", specifier = ">=1.0" },
- { name = "httpx", specifier = ">=0.27" },
- { name = "hypothesis", marker = "extra == 'dev'", specifier = ">=6.100" },
- { name = "jedi", specifier = ">=0.19" },
- { name = "jinja2", specifier = ">=3.1" },
- { name = "json-repair", specifier = ">=0.30" },
- { name = "jsonschema", specifier = ">=4.23" },
- { name = "keyring", specifier = ">=25.5" },
- { name = "loguru", specifier = ">=0.7" },
- { name = "markdown", specifier = ">=3.5" },
- { name = "mcp", specifier = ">=1.28.1,<2" },
- { name = "mss", marker = "extra == 'desktop'", specifier = ">=10.0" },
- { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.13" },
- { name = "num2words", specifier = ">=0.5.13" },
- { name = "numpy", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64') or (python_full_version < '3.14' and sys_platform != 'win32')", specifier = ">=1.26,<2.2" },
- { name = "numpy", marker = "(python_full_version >= '3.14' and platform_machine != 'ARM64') or (python_full_version >= '3.14' and sys_platform != 'win32') or (platform_machine == 'ARM64' and sys_platform == 'win32')", specifier = ">=2.3.5,<2.4" },
- { name = "nvidia-cublas-cu12", marker = "sys_platform != 'darwin' and extra == 'cuda'", specifier = ">=12.4,<13" },
- { name = "nvidia-cudnn-cu12", marker = "sys_platform != 'darwin' and extra == 'cuda'", specifier = ">=9,<10" },
- { name = "onnxruntime", marker = "sys_platform != 'darwin'", specifier = ">=1.17" },
- { name = "onnxruntime", marker = "python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin'", specifier = ">=1.17,<1.24" },
- { name = "openai", specifier = ">=1.30" },
- { name = "opentelemetry-api", specifier = ">=1.28" },
- { name = "opentelemetry-sdk", specifier = ">=1.28" },
- { name = "openwakeword", marker = "(python_full_version < '3.14' and platform_machine == 'arm64' and sys_platform == 'darwin') or (sys_platform != 'darwin' and sys_platform != 'linux')", specifier = ">=0.6" },
- { name = "openwakeword", marker = "python_full_version < '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux'", specifier = ">=0.6" },
- { name = "packaging", specifier = ">=24.0" },
- { name = "paho-mqtt", marker = "extra == 'trigger-streams'", specifier = ">=2.1,<3" },
- { name = "personal-jarvis", extras = ["desktop", "desktop-macos", "telephony", "channels", "local-voice"], marker = "extra == 'full'" },
- { name = "personal-jarvis", extras = ["desktop", "local-voice"], marker = "extra == 'dev'" },
- { name = "pillow", specifier = ">=12.3.0" },
- { name = "platformdirs", specifier = ">=4" },
- { name = "prometheus-client", specifier = ">=0.21" },
- { name = "psutil", specifier = ">=6.1" },
- { name = "ptyprocess", marker = "sys_platform != 'win32' and extra == 'desktop'", specifier = ">=0.7" },
- { name = "pyautogui", marker = "extra == 'desktop'", specifier = ">=0.9.54" },
- { name = "pycaw", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=20240210" },
- { name = "pydantic", specifier = ">=2.9,<3.0" },
- { name = "pydantic-settings", specifier = ">=2.6" },
- { name = "pyinstaller", marker = "extra == 'dev'", specifier = ">=6.11" },
- { name = "pyjwt", specifier = ">=2.14.0" },
- { name = "pynput", marker = "(sys_platform == 'darwin' and extra == 'desktop') or (sys_platform == 'win32' and extra == 'desktop')", specifier = ">=1.7" },
- { name = "pynput", marker = "sys_platform == 'linux' and extra == 'desktop-linux'", specifier = ">=1.7" },
- { name = "pyobjc-framework-accessibility", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
- { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
- { name = "pyobjc-framework-avfoundation", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
- { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
- { name = "pyobjc-framework-screencapturekit", marker = "sys_platform == 'darwin' and extra == 'desktop-macos'", specifier = ">=10" },
- { name = "pypdf", specifier = ">=6.16.1" },
- { name = "pyside6-addons", marker = "(platform_machine != 'aarch64' and extra == 'desktop') or (sys_platform != 'linux' and extra == 'desktop')", specifier = ">=6.7" },
- { name = "pyside6-essentials", marker = "(platform_machine != 'aarch64' and extra == 'desktop') or (sys_platform != 'linux' and extra == 'desktop')", specifier = ">=6.7" },
- { name = "pystray", marker = "extra == 'desktop'", specifier = ">=0.19" },
- { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.3" },
- { name = "pytest-asyncio", marker = "extra == 'dev'", specifier = ">=0.24" },
- { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=6.0" },
- { name = "python-telegram-bot", specifier = ">=22,<23" },
- { name = "pywebview", marker = "extra == 'desktop'", specifier = ">=5.3" },
- { name = "pywin32", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=308" },
- { name = "pywinauto", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.6.9" },
- { name = "pywinpty", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=2.0" },
- { name = "pyyaml", specifier = ">=6.0" },
- { name = "redis", marker = "extra == 'trigger-streams'", specifier = ">=5,<9" },
- { name = "rich", specifier = ">=13.9" },
- { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.7" },
- { name = "scipy", specifier = ">=1.14" },
- { name = "send2trash", specifier = ">=1.8.3" },
- { name = "sherpa-onnx", marker = "(platform_machine != 'ARM64' and extra == 'local-voice') or (sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=1.13.3" },
- { name = "soundcard", marker = "(sys_platform == 'linux' and extra == 'desktop') or (sys_platform == 'win32' and extra == 'desktop')", specifier = ">=0.4.6" },
- { name = "sounddevice", specifier = ">=0.5" },
- { name = "structlog", specifier = ">=24.4" },
- { name = "tenacity", specifier = ">=9.0" },
- { name = "tkinterdnd2", marker = "extra == 'desktop'", specifier = "==0.4.2" },
- { name = "tomlkit", specifier = ">=0.12" },
- { name = "twilio", marker = "extra == 'telephony'", specifier = ">=8.0" },
- { name = "typer", specifier = ">=0.12" },
- { name = "tzdata", specifier = ">=2025.2" },
- { name = "urllib3", specifier = ">=2.8.0" },
- { name = "uvicorn", specifier = ">=0.32" },
- { name = "vosk", marker = "platform_machine != 'ARM64' or sys_platform != 'win32'", specifier = ">=0.3.44,<0.3.45" },
- { name = "watchdog", marker = "(python_full_version < '3.14' and sys_platform == 'darwin') or (platform_machine != 'ARM64' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'win32')", specifier = ">=5.0" },
- { name = "webrtcvad-wheels", marker = "(python_full_version < '3.14' and platform_machine != 'ARM64' and extra == 'local-voice') or (python_full_version < '3.14' and sys_platform != 'win32' and extra == 'local-voice')", specifier = ">=2.0" },
- { name = "websockets", specifier = ">=13" },
- { name = "win10toast-click", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=0.1.2" },
- { name = "winrt-runtime", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
- { name = "winrt-windows-foundation", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
- { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
- { name = "winrt-windows-media-control", marker = "sys_platform == 'win32' and extra == 'desktop'", specifier = ">=3.2" },
-]
-provides-extras = ["trigger-streams", "dev", "full", "telephony", "channels", "desktop", "desktop-linux", "desktop-macos", "local-voice", "cuda", "tts-eval"]
-
[[package]]
name = "pillow"
version = "12.3.0"