Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
refactor: centralize stable product branding
Ruben Lütkedae619e5e579
diff --git a/install/install-verify.ps1 b/install/install-verify.ps1index 9920137b58..e898c48e96 100644--- a/install/install-verify.ps1+++ b/install/install-verify.ps1@@ -50,7 +50,11 @@ $ErrorActionPreference = 'Stop'[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12# ------------------------------------------------------------------- pins-$EXPECTED_REPO = 'PersonalJarvis/PersonalJarvis'+$EXPECTED_REPO = "$env:JARVIS_OFFICIAL_REPO_SLUG"+if (-not $EXPECTED_REPO) { $EXPECTED_REPO = 'PersonalJarvis/PersonalJarvis' }+if ($EXPECTED_REPO -notmatch '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$') {+ throw 'JARVIS_OFFICIAL_REPO_SLUG must be an exact owner/repository slug'+}$EXPECTED_WORKFLOW_PATH = '.github/workflows/sign-installer.yml'$EXPECTED_OIDC_ISSUER = 'https://token.actions.githubusercontent.com'$COSIGN_VERSION = 'v2.4.1'@@ -159,7 +163,8 @@ $EXPECTED_SLSA_SOURCE_URI = "github.com/$EXPECTED_REPO"# The constant below is the actual source of truth, baked into this signed# verifier. Drift means either the layout was modified or the pin is stale -# both are fail-closed.-$EXPECTED_INTOTO_IDENTITY_REGEXP = '^https://github\.com/PersonalJarvis/PersonalJarvis/\.github/workflows/sign-installer\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$'+$ExpectedRepoRegex = [regex]::Escape($EXPECTED_REPO)+$EXPECTED_INTOTO_IDENTITY_REGEXP = "^https://github\.com/$ExpectedRepoRegex/\.github/workflows/sign-installer\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$"# Filename of the SLSA L3 provenance attestation. The release uploads# this file under exactly this name; SA-2 owns the workflow contract.diff --git a/install/install-verify.sh b/install/install-verify.shindex 48230b8a91..aded0db488 100755--- a/install/install-verify.sh+++ b/install/install-verify.sh@@ -65,9 +65,15 @@ set -euo pipefail# sync with install/TRUST_ROOT.md. Bumping any of them is a deliberate# documented event, not a maintenance task.-# Owning repo (for the OIDC identity regex). Users running a fork must-# rebuild the verifier with their fork's slug.-readonly EXPECTED_REPO="PersonalJarvis/PersonalJarvis"+# Owning repo (for the OIDC identity regex). The override supports an official+# repository move while keeping the current identity as the fail-closed default.+readonly DEFAULT_OFFICIAL_REPO_SLUG="PersonalJarvis/PersonalJarvis"+EXPECTED_REPO="${JARVIS_OFFICIAL_REPO_SLUG:-$DEFAULT_OFFICIAL_REPO_SLUG}"+if [[ ! "$EXPECTED_REPO" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then+ printf 'JARVIS_OFFICIAL_REPO_SLUG must be an exact owner/repository slug\n' >&2+ exit 2+fi+readonly EXPECTED_REPO# Path of the signing workflow inside the source repo. Pinned so an# attacker who adds a *different* workflow that signs with the same OIDC@@ -236,7 +242,9 @@ readonly EXPECTED_SLSA_SOURCE_URI="github.com/${EXPECTED_REPO}"# into this signed verifier. We byte-compare the layout's regexp against# this constant on every release; drift means either the layout was# modified or the pin is stale; both are fail-closed.-readonly EXPECTED_INTOTO_IDENTITY_REGEXP='^https://github\.com/PersonalJarvis/PersonalJarvis/\.github/workflows/sign-installer\.yml@refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._-]+)?$'+_expected_repo_regex="${EXPECTED_REPO//./\\.}"+readonly EXPECTED_INTOTO_IDENTITY_REGEXP="^https://github\\.com/${_expected_repo_regex}/\\.github/workflows/sign-installer\\.yml@refs/tags/v[0-9]+\\.[0-9]+\\.[0-9]+(-[A-Za-z0-9._-]+)?$"+unset _expected_repo_regex# Filename of the SLSA L3 provenance attestation emitted by the workflow.# Decoupled from the artifact name so the verifier survives a workflowdiff --git a/install/install.ps1 b/install/install.ps1index d3ee73a75a..d5c990217a 100644--- a/install/install.ps1+++ b/install/install.ps1@@ -195,7 +195,15 @@ function Write-Err([string]$Text) { Write-Host "$Gut $Red$Crs $Text$Rst" }Write-Banner# ----------------------------------------------------------------- config-$RepoUrl = if ($env:JARVIS_INSTALL_REPO) { $env:JARVIS_INSTALL_REPO } else { 'https://github.com/PersonalJarvis/PersonalJarvis.git' }+# Standalone bootstrap projections of jarvis/core/branding.py. The branding+# contract test rejects drift because this script runs before Python is installed.+$OfficialRepoSlug = "$env:JARVIS_OFFICIAL_REPO_SLUG"+if (-not $OfficialRepoSlug) { $OfficialRepoSlug = 'PersonalJarvis/PersonalJarvis' }+if ($OfficialRepoSlug -notmatch '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$') {+ throw 'JARVIS_OFFICIAL_REPO_SLUG must be an exact owner/repository slug'+}+$RepoUrl = if ($env:JARVIS_INSTALL_REPO) { $env:JARVIS_INSTALL_REPO } else { "https://github.com/$OfficialRepoSlug.git" }+$ConfigFileName = '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' }$PrerequisiteMode = if ($env:JARVIS_INSTALL_PREREQS) { $env:JARVIS_INSTALL_PREREQS.ToLowerInvariant() } else { 'ask' }@@ -648,7 +656,7 @@ function Invoke-SalvageReclone {}Write-Note "moved the old directory to $StaleBackup (nothing was deleted)"if (-not (Invoke-FetchPayload)) { exit 1 }- foreach ($Item in @('data', 'jarvis.toml', '.env')) {+ foreach ($Item in @('data', $ConfigFileName, '.env')) {$Old = Join-Path $StaleBackup $Item$New = Join-Path $InstallDir $Itemif ((Test-Path $Old) -and -not (Test-Path $New)) {diff --git a/install/install.sh b/install/install.shindex 76fab4a577..4228b1f83f 100755--- a/install/install.sh+++ b/install/install.sh@@ -17,7 +17,16 @@set -euo pipefail-REPO_URL="${JARVIS_INSTALL_REPO:-https://github.com/PersonalJarvis/PersonalJarvis.git}"+# Standalone bootstrap projections of jarvis/core/branding.py. The branding+# contract test rejects drift because this script runs before Python is installed.+OFFICIAL_REPO_SLUG="${JARVIS_OFFICIAL_REPO_SLUG:-PersonalJarvis/PersonalJarvis}"+if [[ ! "$OFFICIAL_REPO_SLUG" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then+ printf 'JARVIS_OFFICIAL_REPO_SLUG must be an exact owner/repository slug\n' >&2+ exit 2+fi+REPO_URL="${JARVIS_INSTALL_REPO:-https://github.com/${OFFICIAL_REPO_SLUG}.git}"+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}"PREREQUISITE_MODE="${JARVIS_INSTALL_PREREQS:-ask}"@@ -1034,7 +1043,7 @@ salvage_reclone() {note "moved the old directory to $stale_backup (nothing was deleted)"fetch_payload || exit 1local item- for item in data jarvis.toml .env; do+ for item in data "$CONFIG_FILE_NAME" .env; doif [ -e "$stale_backup/$item" ] && [ ! -e "$INSTALL_DIR/$item" ]; thenif cp -R "$stale_backup/$item" "$INSTALL_DIR/$item" 2>/dev/null; thennote "kept your $item from the previous install"@@ -1118,7 +1127,7 @@ if [ -x "$VENV_PYTHON" ]; thennote 'stopped the running Jarvis app for the update'fiif [ "$(uname -s 2>/dev/null)" = "Darwin" ]; then- launchctl unload "$HOME/Library/LaunchAgents/com.personal-jarvis.autostart.plist" >/dev/null 2>&1 || true+ launchctl unload "$HOME/Library/LaunchAgents/${MACOS_AUTOSTART_LABEL}.plist" >/dev/null 2>&1 || truefifidiff --git a/install/installer.py b/install/installer.pyindex 73d254d652..a52ad427a7 100644--- a/install/installer.py+++ b/install/installer.py@@ -48,6 +48,16 @@ import sysimport sysconfigfrom pathlib import Path+_SOURCE_ROOT = Path(__file__).resolve().parent.parent+if str(_SOURCE_ROOT) not in sys.path:+ sys.path.insert(0, str(_SOURCE_ROOT))++from jarvis.core.branding import ( # noqa: E402 - bootstrap source path above+ MACOS_APP_NAME,+ MANAGED_INSTALL_MARKER,+ PRODUCT_NAME,+)+# CLAUDE.md: new CLI modules must use UTF-8 stdout or stick to ASCII. Without# this, the Rich panels render fine but inline bullets break on cp1252 cmd.exe.if hasattr(sys.stdout, "reconfigure"):@@ -259,7 +269,7 @@ def write_managed_marker(*, with_desktop: bool) -> None:the load-bearing safety guard for the whole updater. Best-effort: a markerfailure must never fail the install (it only disables in-app updates)."""- marker = repo_root() / ".jarvis-managed-install"+ marker = repo_root() / MANAGED_INSTALL_MARKERpayload = {"managed": True,"install_path": str(repo_root()),@@ -413,7 +423,7 @@ def step_pip_install(*, with_desktop: bool, with_voice_local: bool, dry_run: boodef is_update_run() -> bool:"""True when this checkout was already installer-managed (re-run = update)."""- return (repo_root() / ".jarvis-managed-install").exists()+ return (repo_root() / MANAGED_INSTALL_MARKER).exists()def step_models(*, dry_run: bool) -> None:@@ -697,7 +707,7 @@ def step_launch(*, headless: bool, dry_run: bool) -> None:# The install itself is complete; launch through LaunchServices# by app name instead of failing the whole run. Ported from the Mac# line (BUG-066 there; the local register merged it as BUG-078).- cmd = ["/usr/bin/open", "-a", "Personal Jarvis"]+ cmd = ["/usr/bin/open", "-a", MACOS_APP_NAME]msg = "the Desktop App"else:bundle = macos_app_bundle_path()@@ -738,12 +748,14 @@ def step_summary(*, no_launch: bool, update: bool, headless: bool) -> None:"""rows: list[tuple[str, str, str]] = [("Installed to", str(repo_root()), "muted")]if sys.platform == "win32":- rows.append(("Start again", 'Windows search -> "Personal Jarvis"', "brand"))+ rows.append(("Start again", f'Windows search -> "{PRODUCT_NAME}"', "brand"))elif sys.platform == "darwin":- rows.append(("Start again", 'Spotlight → "Personal Jarvis" (app in ~/Applications)', "brand"))+ rows.append(+ ("Start again", f'Spotlight → "{PRODUCT_NAME}" (app in ~/Applications)', "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", 'app menu -> "Personal Jarvis"', "brand"))+ rows.append(("Start again", f'app menu -> "{PRODUCT_NAME}"', "brand"))else:rows.append(("Start again", ".venv/bin/python -m jarvis.ui.web.launcher", "brand"))rows.append(("", "(in the install folder)", "muted"))@@ -758,7 +770,7 @@ def step_summary(*, no_launch: bool, update: bool, headless: bool) -> None:rows.append(("Next", "the app opens with a one-time setup guide", "muted"))rows.append(("", "(language, wake word, API keys) - it never shows again", "muted"))- title = f"Personal Jarvis is {'updated' if update else 'ready'}"+ title = f"{PRODUCT_NAME} is {'updated' if update else 'ready'}"key_w = 13# Widths are computed on the PLAIN text (markup added only when printing),# so the right border always lines up.@@ -784,7 +796,7 @@ def step_summary(*, no_launch: bool, update: bool, headless: bool) -> None:def main(argv: list[str] | None = None) -> int:parser = argparse.ArgumentParser(prog="installer.py",- description="Personal Jarvis Stage-2 installer",+ description=f"{PRODUCT_NAME} Stage-2 installer",)parser.add_argument("--no-wizard", action="store_true",help="deprecated no-op: the installer never runs the terminal "diff --git a/install/uninstall.ps1 b/install/uninstall.ps1index e815bb8b14..5a284af66e 100644--- a/install/uninstall.ps1+++ b/install/uninstall.ps1@@ -58,7 +58,14 @@ function Stop-JarvisProcesses([string]$Root) {Write-Ok "Stopped the running Jarvis app ($($Procs.Count) process(es))."}-$InstallDir = if ($env:JARVIS_INSTALL_DIR) { $env:JARVIS_INSTALL_DIR } else { Join-Path $env:USERPROFILE '.personal-jarvis' }+# Standalone fallback projections of jarvis/core/branding.py. These remain+# available even when a broken venv prevents importing the installed package.+$DefaultInstallDirName = '.personal-jarvis'+$WindowsShortcutFileName = 'Personal Jarvis.lnk'+$WindowsUninstallRegistrySubkey = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\PersonalJarvis'+$WindowsAppUserModelId = 'PersonalJarvis.PersonalJarvis'++$InstallDir = if ($env:JARVIS_INSTALL_DIR) { $env:JARVIS_INSTALL_DIR } else { Join-Path $env:USERPROFILE $DefaultInstallDirName }$VenvPython = Join-Path $InstallDir '.venv\Scripts\python.exe'Write-Step 'Uninstall Personal Jarvis'@@ -87,11 +94,11 @@ 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\Personal Jarvis.lnk'+ $Shortcut = Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs\$WindowsShortcutFileName"Remove-Item -LiteralPath $Shortcut -Force -ErrorAction SilentlyContinue}- Remove-Item -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\PersonalJarvis' -Recurse -Force -ErrorAction SilentlyContinue- Remove-Item -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Classes\AppUserModelId\PersonalJarvis.PersonalJarvis' -Recurse -Force -ErrorAction SilentlyContinue+ 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 SilentlyContinueWrite-Ok 'Removed the desktop app registration.'$Rc = 0}diff --git a/install/uninstall.sh b/install/uninstall.shindex ca2ee25ff2..6749aa0bbf 100644--- a/install/uninstall.sh+++ b/install/uninstall.sh@@ -18,7 +18,14 @@set -euo pipefail-INSTALL_DIR="${JARVIS_INSTALL_DIR:-$HOME/.personal-jarvis}"+# Standalone fallback projections of jarvis/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"+LINUX_DESKTOP_ENTRY_FILE_NAME="personal-jarvis.desktop"+KEYRING_SERVICE_NAME="personal-jarvis"++INSTALL_DIR="${JARVIS_INSTALL_DIR:-$HOME/$DEFAULT_INSTALL_DIR_NAME}"VENV_PYTHON="$INSTALL_DIR/.venv/bin/python"if [ -t 1 ]; then@@ -123,10 +130,10 @@ elseficase "$(uname -s)" inDarwin)- rm -rf -- "$HOME/Applications/Personal Jarvis.app"+ rm -rf -- "$HOME/Applications/$MACOS_APP_DIR_NAME";;Linux)- rm -f -- "${XDG_DATA_HOME:-$HOME/.local/share}/applications/personal-jarvis.desktop"+ rm -f -- "${XDG_DATA_HOME:-$HOME/.local/share}/applications/$LINUX_DESKTOP_ENTRY_FILE_NAME";;esacok 'Removed the desktop app registration.'@@ -152,7 +159,7 @@ elif [ "$RC" -ne 0 ]; thennote 'broken by a system/Homebrew Python upgrade.'note 'To remove Jarvis anyway:'note " rm -rf \"$INSTALL_DIR\""- note 'Saved API keys then stay in your OS keychain under "personal-jarvis".'+ note "Saved API keys then stay in your OS keychain under \"$KEYRING_SERVICE_NAME\"."exit "$RC"fidiff --git a/jarvis/autostart/command.py b/jarvis/autostart/command.pyindex 1694b29c9c..64cec53657 100644--- a/jarvis/autostart/command.py+++ b/jarvis/autostart/command.py@@ -18,6 +18,7 @@ import subprocessimport sysfrom pathlib import Path+from jarvis.core.branding import MACOS_APP_DIR_NAMEfrom jarvis.core.config import PROJECT_ROOTfrom jarvis.core.process_utils import NO_WINDOW_CREATIONFLAGS@@ -88,7 +89,7 @@ def resolve_launch_spec(cfg: object | None = None) -> LaunchSpec:# identity used by Spotlight and manual launches. Never fall back to a# raw interpreter: that would create a second TCC identity and make# grants appear to vanish. Missing bundles fail closed until repaired.- bundle = Path.home() / "Applications" / "Personal Jarvis.app"+ bundle = Path.home() / "Applications" / MACOS_APP_DIR_NAMEprogram = "/usr/bin/open"try:from jarvis.setup.macos_app_bundle import (diff --git a/jarvis/autostart/linux.py b/jarvis/autostart/linux.pyindex be9c5e4dca..a82812bf39 100644--- a/jarvis/autostart/linux.py+++ b/jarvis/autostart/linux.py@@ -16,17 +16,24 @@ import loggingimport osfrom pathlib import Path+from jarvis.core.branding import (+ LINUX_APP_NAME as _APP_NAME,+)+from jarvis.core.branding import (+ LINUX_DESKTOP_ENTRY_FILE_NAME as _ENTRY_NAME,+)+from jarvis.core.branding import (+ LINUX_WM_CLASS as _WM_CLASS,+)+from .protocol import AutostartStatus, LaunchSpeclog = logging.getLogger(__name__)-_ENTRY_NAME = "personal-jarvis.desktop"-_APP_NAME = "Personal Jarvis"# The X11/Wayland window-class token the running window is pinned to (see# ``jarvis.ui.icon_utils.pin_linux_wm_class``). ``StartupWMClass`` must match it# for the desktop to map the running window to THIS .desktop entry — and thus# show its ``Icon=`` on the taskbar/dock instead of the generic python3 icon.-_WM_CLASS = "personal-jarvis"def _icon_value() -> str | None:diff --git a/jarvis/autostart/macos.py b/jarvis/autostart/macos.pyindex 2bfd273045..02d3938f33 100644--- a/jarvis/autostart/macos.py+++ b/jarvis/autostart/macos.py@@ -22,11 +22,12 @@ import subprocessimport sysfrom pathlib import Path+from jarvis.core.branding import MACOS_AUTOSTART_LABEL as _LABEL+from .protocol import AutostartStatus, LaunchSpeclog = logging.getLogger(__name__)-_LABEL = "com.personal-jarvis.autostart"_ENTRY_NAME = f"{_LABEL}.plist"diff --git a/jarvis/autostart/windows.py b/jarvis/autostart/windows.pyindex 55384344c7..52338e3f11 100644--- a/jarvis/autostart/windows.py+++ b/jarvis/autostart/windows.py@@ -39,6 +39,15 @@ from collections.abc import Callablefrom dataclasses import dataclassfrom pathlib import Path+from jarvis.core.branding import (+ WINDOWS_AUTOSTART_DESCRIPTION,+)+from jarvis.core.branding import (+ WINDOWS_AUTOSTART_TASK_NAME as TASK_NAME,+)+from jarvis.core.branding import (+ WINDOWS_SHORTCUT_FILE_NAME as _SHORTCUT_NAME,+)from jarvis.core.process_utils import NO_WINDOW_CREATIONFLAGSfrom .protocol import AutostartStatus, LaunchSpec@@ -46,12 +55,10 @@ from .protocol import AutostartStatus, LaunchSpeclog = logging.getLogger(__name__)# Scheduled-task identity. A stable name so reconcile can find/refresh it.-TASK_NAME = "Personal Jarvis Autostart"# How long after login the task waits before launching — lets the desktop settle# without the multi-minute Explorer startup throttle._LOGON_DELAY_SECONDS = 20-_SHORTCUT_NAME = "Personal Jarvis.lnk"# 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")@@ -128,7 +135,7 @@ def build_register_task_script("-MultipleInstances IgnoreNew\n"f" Register-ScheduledTask -TaskName '{task_name}' -Action $action ""-Trigger $trigger -Principal $principal -Settings $settings "- "-Description 'Personal Jarvis (Autostart)' -Force | Out-Null\n"+ f"-Description '{WINDOWS_AUTOSTART_DESCRIPTION}' -Force | Out-Null\n"" exit 0\n""} catch { exit 1 }\n")@@ -195,7 +202,7 @@ def build_create_script(link: Path, spec: LaunchSpec, *, icon: str | None = Nonef"$sc.TargetPath = '{spec.program}'\n"f"$sc.Arguments = '{args}'\n"f"$sc.WorkingDirectory = '{spec.working_dir}'\n"- "$sc.Description = 'Personal Jarvis (Autostart)'\n"+ f"$sc.Description = '{WINDOWS_AUTOSTART_DESCRIPTION}'\n"f"{icon_line}"f"$sc.WindowStyle = {window_style}\n""$sc.Save()\n"diff --git a/jarvis/core/branding.py b/jarvis/core/branding.pynew file mode 100644index 0000000000..e9c0b6ae5d--- /dev/null+++ b/jarvis/core/branding.py@@ -0,0 +1,115 @@+"""Stable product identity constants shared across runtime surfaces.++This module is intentionally standard-library-only and performs no filesystem or+network I/O. Persistent names are compatibility contracts: changing one without+an explicit migration would orphan an existing installation's files, credentials,+desktop entries, or update channel.+"""++from __future__ import annotations++import os+from collections.abc import Mapping++PRODUCT_NAME = "Personal Jarvis"+PRODUCT_COMPACT_NAME = "PersonalJarvis"+PRODUCT_SLUG = "personal-jarvis"++CONFIG_FILE_NAME = "jarvis.toml"+KEYRING_SERVICE_NAME = PRODUCT_SLUG+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 = rf"Global\{PRODUCT_COMPACT_NAME}_v1"+WINDOWS_APP_USER_MODEL_ID = f"{PRODUCT_COMPACT_NAME}.{PRODUCT_COMPACT_NAME}"+WINDOWS_UNINSTALL_REGISTRY_SUBKEY = (+ rf"Software\Microsoft\Windows\CurrentVersion\Uninstall\{PRODUCT_COMPACT_NAME}"+)+WINDOWS_AUTOSTART_TASK_NAME = f"{PRODUCT_NAME} Autostart"+WINDOWS_SHORTCUT_FILE_NAME = f"{PRODUCT_NAME}.lnk"+WINDOWS_AUTOSTART_DESCRIPTION = f"{PRODUCT_NAME} (Autostart)"+WINDOWS_BRANDED_LAUNCHER_FILE_NAME = f"{PRODUCT_COMPACT_NAME}.exe"+WINDOWS_BRANDED_LAUNCHER_DIR_NAME = PRODUCT_COMPACT_NAME++MACOS_APP_NAME = PRODUCT_NAME+MACOS_APP_DIR_NAME = f"{MACOS_APP_NAME}.app"+MACOS_EXECUTABLE_NAME = PRODUCT_COMPACT_NAME+MACOS_BUNDLE_ID = f"com.{PRODUCT_SLUG}.desktop"+MACOS_AUTOSTART_LABEL = f"com.{PRODUCT_SLUG}.autostart"++LINUX_APP_NAME = PRODUCT_NAME+LINUX_DESKTOP_ENTRY_FILE_NAME = f"{PRODUCT_SLUG}.desktop"+LINUX_WM_CLASS = PRODUCT_SLUG++DEFAULT_OFFICIAL_REPO_SLUG = "PersonalJarvis/PersonalJarvis"+OFFICIAL_REPO_SLUG_ENV_VAR = "JARVIS_OFFICIAL_REPO_SLUG"+++def resolve_official_repo_slug(environ: Mapping[str, str] | None = None) -> str:+ """Resolve one exact ``owner/repository`` slug from the process environment."""++ source = os.environ if environ is None else environ+ candidate = source.get(OFFICIAL_REPO_SLUG_ENV_VAR, "")+ if not candidate:+ return DEFAULT_OFFICIAL_REPO_SLUG+ parts = candidate.split("/")+ allowed = frozenset("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-")+ if len(parts) != 2 or any(not part or not set(part) <= allowed for part in parts):+ raise ValueError(+ f"{OFFICIAL_REPO_SLUG_ENV_VAR} must be an exact owner/repository slug"+ )+ return candidate+++OFFICIAL_REPO_SLUG = resolve_official_repo_slug()+OFFICIAL_REPO_URL = f"https://github.com/{OFFICIAL_REPO_SLUG}"+OFFICIAL_REPO_GIT_URL = f"{OFFICIAL_REPO_URL}.git"+OFFICIAL_RELEASES_LATEST_API_URL = (+ f"https://api.github.com/repos/{OFFICIAL_REPO_SLUG}/releases/latest"+)+UPDATER_USER_AGENT = f"{PRODUCT_COMPACT_NAME}-Updater"++__all__ = [+ "CONFIG_FILE_NAME",+ "CONTROL_KEY_PREFIX",+ "DEFAULT_OFFICIAL_REPO_SLUG",+ "DEFAULT_INSTALL_DIR_NAME",+ "DESKTOP_OUTPUT_MIRROR_DIR_NAME",+ "FALLBACK_USER_DATA_DIR_NAME",+ "KEYRING_SERVICE_NAME",+ "LINUX_APP_NAME",+ "LINUX_DESKTOP_ENTRY_FILE_NAME",+ "LINUX_WM_CLASS",+ "MACOS_APP_DIR_NAME",+ "MACOS_APP_NAME",+ "MACOS_AUTOSTART_LABEL",+ "MACOS_BUNDLE_ID",+ "MACOS_EXECUTABLE_NAME",+ "MANAGED_INSTALL_MARKER",+ "OFFICIAL_RELEASES_LATEST_API_URL",+ "OFFICIAL_REPO_GIT_URL",+ "OFFICIAL_REPO_SLUG",+ "OFFICIAL_REPO_SLUG_ENV_VAR",+ "OFFICIAL_REPO_URL",+ "PRODUCT_COMPACT_NAME",+ "PRODUCT_NAME",+ "PRODUCT_SLUG",+ "SESSION_COOKIE_NAME",+ "UPDATER_USER_AGENT",+ "WINDOWS_APP_USER_MODEL_ID",+ "WINDOWS_AUTOSTART_DESCRIPTION",+ "WINDOWS_AUTOSTART_TASK_NAME",+ "WINDOWS_BRANDED_LAUNCHER_DIR_NAME",+ "WINDOWS_BRANDED_LAUNCHER_FILE_NAME",+ "WINDOWS_MUTEX_NAME",+ "WINDOWS_SHORTCUT_FILE_NAME",+ "WINDOWS_UNINSTALL_REGISTRY_SUBKEY",+ "WINDOWS_USER_DATA_DIR_NAME",+ "resolve_official_repo_slug",+]diff --git a/jarvis/core/config.py b/jarvis/core/config.pyindex 82fded34e7..f98d423e10 100644--- a/jarvis/core/config.py+++ b/jarvis/core/config.py@@ -38,6 +38,7 @@ from jarvis.awareness.config import AwarenessConfig# wake-engine enum + the default phrase.from jarvis.speech.wake_constants import DEFAULT_WAKE_PHRASE, WAKE_ENGINES+from .branding import CONFIG_FILE_NAME, KEYRING_SERVICE_NAMEfrom .protocols import RiskTier# AckBrainConfig lives under jarvis.brain.ack_brain.config. We cannot@@ -54,7 +55,7 @@ if TYPE_CHECKING:# ----------------------------------------------------------------------PROJECT_ROOT = Path(__file__).resolve().parents[2]-DEFAULT_CONFIG_FILE = PROJECT_ROOT / "jarvis.toml"+DEFAULT_CONFIG_FILE = PROJECT_ROOT / CONFIG_FILE_NAMEPROFILES_DIR = PROJECT_ROOT / "profiles"DATA_DIR = PROJECT_ROOT / "data"ASSETS_DIR = PROJECT_ROOT / "assets"@@ -122,7 +123,7 @@ def resolve_config_path() -> Path:return Path(override.strip())return DEFAULT_CONFIG_FILE-KEYRING_SERVICE = "personal-jarvis"+KEYRING_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,diff --git a/jarvis/core/control_key.py b/jarvis/core/control_key.pyindex 1b9c79513b..08c6fba3c6 100644--- a/jarvis/core/control_key.py+++ b/jarvis/core/control_key.py@@ -38,17 +38,23 @@ import threadingfrom pathlib import Pathfrom jarvis.core import config as cfg+from jarvis.core.branding import (+ CONTROL_KEY_PREFIX as KEY_PREFIX,+)+from jarvis.core.branding import (+ MACOS_APP_NAME as _MACOS_APP_NAME,+)+from jarvis.core.branding import (+ MACOS_BUNDLE_ID as _MACOS_BUNDLE_ID,+)logger = logging.getLogger(__name__)-KEY_PREFIX = "jctl_"KEYRING_SLOT = "jarvis_control_api_key"ENV_VAR = "JARVIS_CONTROL_API_KEY"_FILE_NAME = ".control_api_key"_MACOS_OWNER_FILE_NAME = ".control_api_key.macos-owner"_TOKEN_BYTES = 32 # 256-bit-_MACOS_APP_NAME = "Personal Jarvis"-_MACOS_BUNDLE_ID = "com.personal-jarvis.desktop"# Authentication runs on every protected HTTP request. Reading a macOS# Keychain item's secret data on every comparison used to produce one passworddiff --git a/jarvis/core/paths.py b/jarvis/core/paths.pyindex ac6efe41a9..a67ebe3f5a 100644--- a/jarvis/core/paths.py+++ b/jarvis/core/paths.py@@ -17,6 +17,12 @@ import sysimport sysconfigfrom pathlib import Path+from jarvis.core.branding import (+ DESKTOP_OUTPUT_MIRROR_DIR_NAME,+ FALLBACK_USER_DATA_DIR_NAME,+ WINDOWS_USER_DATA_DIR_NAME,+)+def user_data_dir() -> Path:"""App data directory in the user context.@@ -29,8 +35,8 @@ def user_data_dir() -> Path:"""base = os.environ.get("LOCALAPPDATA")if base:- return Path(base) / "Jarvis"- return Path.home() / ".jarvis"+ return Path(base) / WINDOWS_USER_DATA_DIR_NAME+ return Path.home() / FALLBACK_USER_DATA_DIR_NAMEdef user_skills_dir() -> Path:@@ -150,7 +156,7 @@ def user_outputs_dir() -> Path:def desktop_mirror_dir() -> Path:"""Desktop junction root for direct access to sub-agent outputs."""- return Path.home() / "Desktop" / "Jarvis-Output"+ return Path.home() / "Desktop" / DESKTOP_OUTPUT_MIRROR_DIR_NAMEdef ensure_session_output_dir(slug: str) -> tuple[Path, Path]:diff --git a/jarvis/core/self_mod/writer.py b/jarvis/core/self_mod/writer.pyindex f3db9c1309..024d144ad2 100644--- a/jarvis/core/self_mod/writer.py+++ b/jarvis/core/self_mod/writer.py@@ -45,6 +45,7 @@ from pydantic import ValidationError as PydanticValidationErrorfrom tomlkit import TOMLDocumentfrom tomlkit.items import AbstractTable+from jarvis.core.branding import CONFIG_FILE_NAMEfrom jarvis.core.bus import EventBusfrom jarvis.core.config import (JarvisConfig,@@ -78,7 +79,7 @@ _LOG = logging.getLogger(__name__)# Plan-§AD-6 / §7.2: Backup directory lives directly next to `jarvis.toml`.DEFAULT_BACKUP_SUBDIR = ".backups"-BACKUP_FILE_GLOB = "jarvis.toml.*.bak"+BACKUP_FILE_GLOB = f"{CONFIG_FILE_NAME}.*.bak"BACKUP_TS_FORMAT = "%Y%m%dT%H%M%S_%fZ"@@ -526,7 +527,7 @@ class AtomicConfigWriter:# mkstemp writes the final .bak file directly; uniqueness is OS-guaranteed.fd, target_name = tempfile.mkstemp(suffix=".bak",- prefix=f"jarvis.toml.{ts}.",+ prefix=f"{CONFIG_FILE_NAME}.{ts}.",dir=str(self._backup_dir),)target = Path(target_name)diff --git a/jarvis/marketplace/auth/oauth_dcr.py b/jarvis/marketplace/auth/oauth_dcr.pyindex 77504545e4..e346a57384 100644--- a/jarvis/marketplace/auth/oauth_dcr.py+++ b/jarvis/marketplace/auth/oauth_dcr.py@@ -33,6 +33,7 @@ from urllib.parse import urlencode, urlsplit, urlunsplitimport httpx+from jarvis.core.branding import OFFICIAL_REPO_URL, PRODUCT_NAMEfrom jarvis.marketplace.auth.base import (AuthSession,FlowResult,@@ -63,8 +64,8 @@ class DcrConfig:fallback_authorization_endpoint: str | None = Nonefallback_token_endpoint: str | None = Nonefallback_registration_endpoint: str | None = None- client_name: str = "Personal Jarvis"- client_uri: str = "https://github.com/PersonalJarvis/PersonalJarvis"+ client_name: str = PRODUCT_NAME+ client_uri: str = OFFICIAL_REPO_URLtimeout_seconds: int = 10diff --git a/jarvis/platform/permissions.py b/jarvis/platform/permissions.pyindex 0e079a005d..ab346012c2 100644--- a/jarvis/platform/permissions.py+++ b/jarvis/platform/permissions.py@@ -18,12 +18,17 @@ from enum import StrEnumfrom pathlib import Pathfrom typing import Any+from jarvis.core.branding import (+ MACOS_APP_NAME as APP_NAME,+)+from jarvis.core.branding import (+ MACOS_BUNDLE_ID as EXPECTED_BUNDLE_ID,+)+from . import PlatformName, detect_platformlog = logging.getLogger(__name__)-EXPECTED_BUNDLE_ID = "com.personal-jarvis.desktop"-APP_NAME = "Personal Jarvis"_SYSTEM_SETTINGS_BUNDLE_ID = "com.apple.systempreferences"diff --git a/jarvis/setup/desktop_integration.py b/jarvis/setup/desktop_integration.pyindex c0d6c95c8c..7e43fff757 100644--- a/jarvis/setup/desktop_integration.py+++ b/jarvis/setup/desktop_integration.py@@ -28,13 +28,21 @@ from dataclasses import asdict, dataclassfrom pathlib import Pathfrom typing import Any-log = logging.getLogger(__name__)--MANAGED_MARKER = ".jarvis-managed-install"-WINDOWS_UNINSTALL_SUBKEY = (- r"Software\Microsoft\Windows\CurrentVersion\Uninstall\PersonalJarvis"+from jarvis.core.branding import (+ LINUX_DESKTOP_ENTRY_FILE_NAME,+ OFFICIAL_REPO_URL,+ PRODUCT_NAME,+ WINDOWS_APP_USER_MODEL_ID,+ WINDOWS_SHORTCUT_FILE_NAME,+)+from jarvis.core.branding import (+ MANAGED_INSTALL_MARKER as MANAGED_MARKER,+)+from jarvis.core.branding import (+ WINDOWS_UNINSTALL_REGISTRY_SUBKEY as WINDOWS_UNINSTALL_SUBKEY,)-WINDOWS_APP_USER_MODEL_ID = "PersonalJarvis.PersonalJarvis"++log = logging.getLogger(__name__)def _windows_aumid_subkey(aumid: str) -> str:@@ -127,13 +135,13 @@ def windows_uninstall_values(str(script),]values: dict[str, str | int] = {- "DisplayName": "Personal Jarvis",+ "DisplayName": PRODUCT_NAME,"DisplayVersion": version or _version(),- "Publisher": "Personal Jarvis contributors",+ "Publisher": f"{PRODUCT_NAME} contributors","InstallLocation": str(install_dir),"UninstallString": subprocess.list2cmdline(base),"QuietUninstallString": subprocess.list2cmdline([*base, "--yes"]),- "URLInfoAbout": "https://github.com/PersonalJarvis/PersonalJarvis",+ "URLInfoAbout": OFFICIAL_REPO_URL,"NoModify": 1,"NoRepair": 1,}@@ -210,7 +218,7 @@ def _remove_windows_desktop_integration(warnings: list[str] = []programs = programs_dir or _windows_programs_dir()if programs is not None:- shortcut = programs / "Personal Jarvis.lnk"+ shortcut = programs / WINDOWS_SHORTCUT_FILE_NAMEtry:shortcut.unlink(missing_ok=True)except OSError as exc:@@ -229,7 +237,9 @@ def _linux_applications_dir() -> Path:def _remove_linux_desktop_entry(applications_dir: Path | None = None) -> bool:- entry = (applications_dir or _linux_applications_dir()) / "personal-jarvis.desktop"+ entry = (+ applications_dir or _linux_applications_dir()+ ) / LINUX_DESKTOP_ENTRY_FILE_NAMEtry:entry.unlink(missing_ok=True)return True@@ -304,7 +314,7 @@ def ensure_desktop_integration():artifacts.append("installed_apps_registration")else:- warnings.append("could not register Personal Jarvis in Installed Apps")+ warnings.append(f"could not register {PRODUCT_NAME} in Installed Apps")elif plat == "macos":try:from jarvis.setup import macos_app_bundle@@ -427,7 +437,9 @@ def main(argv: list[str] | None = None) -> int:# Route log.warning detail to stderr so the installer can surface the real# failure reason; the --json contract stays: JSON is the last stdout line.logging.basicConfig(level=logging.INFO, stream=sys.stderr)- parser = argparse.ArgumentParser(description="Repair Personal Jarvis desktop registration")+ parser = argparse.ArgumentParser(+ description=f"Repair {PRODUCT_NAME} desktop registration"+ )parser.add_argument("--install-dir", type=Path, default=None)parser.add_argument("--remove", action="store_true")parser.add_argument("--allow-unmanaged", action="store_true")@@ -445,9 +457,9 @@ def main(argv: list[str] | None = None) -> int:if args.json:print(json.dumps(report.to_dict(), sort_keys=True))elif report.ok:- print("Personal Jarvis desktop registration is ready.")+ print(f"{PRODUCT_NAME} desktop registration is ready.")else:- print("Personal Jarvis desktop registration is incomplete.", file=sys.stderr)+ print(f"{PRODUCT_NAME} desktop registration is incomplete.", file=sys.stderr)for warning in report.warnings:print(f"- {warning}", file=sys.stderr)return 0 if report.ok else 1diff --git a/jarvis/setup/macos_app_bundle.py b/jarvis/setup/macos_app_bundle.pyindex 23861c8b4f..4dd37e0ee4 100644--- a/jarvis/setup/macos_app_bundle.py+++ b/jarvis/setup/macos_app_bundle.py@@ -36,13 +36,22 @@ import sysimport tempfilefrom pathlib import Path+from jarvis.core.branding import (+ MACOS_APP_DIR_NAME as APP_DIR_NAME,+)+from jarvis.core.branding import (+ MACOS_APP_NAME as APP_NAME,+)+from jarvis.core.branding import (+ MACOS_BUNDLE_ID as BUNDLE_ID,+)+from jarvis.core.branding import (+ MACOS_EXECUTABLE_NAME,+)from jarvis.core.process_utils import NO_WINDOW_CREATIONFLAGSlog = logging.getLogger(__name__)-APP_NAME = "Personal Jarvis"-APP_DIR_NAME = f"{APP_NAME}.app"-BUNDLE_ID = "com.personal-jarvis.desktop"# 2: stub launcher sets only LC_CTYPE (BUG-079 — LC_ALL leaked a de_DE# LC_NUMERIC into native libs; libvosk then emitted malformed JSON). Bumping# forces existing bundles through a rebuild on the next ensure pass.@@ -82,12 +91,12 @@ def last_error() -> str | None:return _LAST_ERROR-_MIC_USAGE = "Personal Jarvis listens on this microphone for your wake word and voice commands."+_MIC_USAGE = f"{APP_NAME} listens on this microphone for your wake word and voice commands."_SCREEN_CAPTURE_USAGE = (- "Personal Jarvis captures the screen only when you ask it to see or control applications."+ f"{APP_NAME} captures the screen only when you ask it to see or control applications.")_APPLE_EVENTS_USAGE = (- "Personal Jarvis lowers Music/Spotify volume while you dictate and restores it afterwards."+ f"{APP_NAME} lowers Music/Spotify volume while you dictate and restores it afterwards.")@@ -353,7 +362,7 @@ def _write_cross_platform_fixture_bundle(bundle: Path) -> Path:resources = contents / "Resources"macos_dir.mkdir(parents=True)resources.mkdir(parents=True)- executable_name = "PersonalJarvis"+ executable_name = MACOS_EXECUTABLE_NAMEexecutable = macos_dir / executable_nameexecutable.write_bytes(b"\xcf\xfa\xed\xfeJARVIS_TEST_FIXTURE\n")executable.chmod(executable.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)@@ -523,7 +532,7 @@ def _build_native_bundle(install_root: Path, work_dir: Path) -> Path:macos_dir.mkdir(parents=True)resources.mkdir(parents=True)- executable_name = "PersonalJarvis"+ executable_name = MACOS_EXECUTABLE_NAMEplist = _bundle_plist()plist["CFBundleExecutable"] = executable_nameicon_stem = _try_build_icns(resources)diff --git a/jarvis/setup/uninstall.py b/jarvis/setup/uninstall.pyindex c08632b099..af16869607 100644--- a/jarvis/setup/uninstall.py+++ b/jarvis/setup/uninstall.py@@ -48,6 +48,7 @@ from rich.panel import Panelfrom rich.theme import Themefrom jarvis.core import config as cfg+from jarvis.core.branding import CONFIG_FILE_NAMEfrom jarvis.setup.wizard import SECRETS# Same Charcoal + Gold palette as install/installer.py and the first-run wizard,@@ -78,7 +79,7 @@ class UninstallPlan:@propertydef config_file(self) -> Path:- return self.install_dir / "jarvis.toml"+ return self.install_dir / CONFIG_FILE_NAME@propertydef data_dir(self) -> Path:diff --git a/jarvis/ui/desktop_app.py b/jarvis/ui/desktop_app.pyindex 00ecc5363b..c685897b1c 100644--- a/jarvis/ui/desktop_app.py+++ b/jarvis/ui/desktop_app.py@@ -42,6 +42,7 @@ if sys.platform == "win32":from filelock import FileLock, Timeout+from jarvis.core.branding import PRODUCT_NAME as WINDOW_TITLEfrom jarvis.core.config import DATA_DIR, JarvisConfig, load_configif TYPE_CHECKING:@@ -54,8 +55,6 @@ if TYPE_CHECKING:LOCK_FILE_PATH = DATA_DIR / "jarvis.lock"META_FILE_PATH = DATA_DIR / ".jarvis-running"-WINDOW_TITLE = "Personal Jarvis"-#: Timeout for the initial lock acquire, in seconds. 0 = non-blocking,#: so we detect a running process immediately and focus it instead of#: waiting silently.diff --git a/jarvis/ui/icon_utils.py b/jarvis/ui/icon_utils.pyindex b9e5a56004..851b672845 100644--- a/jarvis/ui/icon_utils.py+++ b/jarvis/ui/icon_utils.py@@ -17,6 +17,26 @@ from typing import Anyfrom loguru import logger+from jarvis.core.branding import (+ LINUX_DESKTOP_ENTRY_FILE_NAME as LINUX_DESKTOP_ENTRY_NAME,+)+from jarvis.core.branding import (+ LINUX_WM_CLASS,+ WINDOWS_BRANDED_LAUNCHER_DIR_NAME,+)+from jarvis.core.branding import (+ PRODUCT_NAME as APP_DISPLAY_NAME,+)+from jarvis.core.branding import (+ WINDOWS_APP_USER_MODEL_ID as APP_USER_MODEL_ID,+)+from jarvis.core.branding import (+ WINDOWS_BRANDED_LAUNCHER_FILE_NAME as BRANDED_LAUNCHER_EXE_NAME,+)+from jarvis.core.branding import (+ WINDOWS_SHORTCUT_FILE_NAME as START_MENU_SHORTCUT_NAME,+)+_WM_SETICON = 0x0080_ICON_SMALL = 0_ICON_BIG = 1@@ -33,8 +53,6 @@ _LR_DEFAULTSIZE = 0x00000040_GCLP_HICON = -14_GCLP_HICONSM = -34-APP_USER_MODEL_ID = "PersonalJarvis.PersonalJarvis"-# The friendly name Windows shows on taskbar hover and in the jump-list header.# This is a *different* layer from the AUMID grouping key above: the key only# groups the button. The name is resolved by matching the running window's AUMID@@ -44,11 +62,8 @@ APP_USER_MODEL_ID = "PersonalJarvis.PersonalJarvis"# (``pythonw.exe`` -> "Python"), which is the "taskbar says Python" symptom.# (The HKCU ``DisplayName`` registered below is the *toast-notification*# identity, a separate surface — it does NOT name the taskbar button.)-APP_DISPLAY_NAME = "Personal Jarvis"-# Start-Menu shortcut whose *file name* becomes the taskbar button name. The# launcher module is the relaunch target so a fresh click reopens the app.-START_MENU_SHORTCUT_NAME = "Personal Jarvis.lnk"_LAUNCHER_MODULE = "jarvis.ui.web.launcher"# IID_IPropertyStore — the COM interface for reading/writing a .lnk's AUMID._IID_IPROPERTYSTORE = "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}"@@ -62,7 +77,6 @@ _IID_IPROPERTYSTORE = "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}"# the Python logo on the taskbar no matter how much window-icon work we do; the# ONLY fix is to launch from an exe whose embedded icon is the mascot. See# ``ensure_branded_launcher_exe`` + ``maybe_reexec_through_branded_launcher``.-BRANDED_LAUNCHER_EXE_NAME = "PersonalJarvis.exe"# Set in the child's env when we re-exec through the branded exe, so the child# does not re-exec again (loop guard)._BRANDED_LAUNCH_ENV = "JARVIS_BRANDED_LAUNCH"@@ -233,7 +247,7 @@ def _user_launcher_dir() -> Path | None:local = os.environ.get("LOCALAPPDATA")if not local:return None- return Path(local) / "PersonalJarvis" / "bin"+ return Path(local) / WINDOWS_BRANDED_LAUNCHER_DIR_NAME / "bin"def _branded_launcher_candidates() -> list[Path]:@@ -1005,9 +1019,6 @@ def set_window_icon_for_pid(pid: int, ico_path: Path) -> bool:# (jarvis/autostart/linux.py). Keep the two in lock-step: the desktop maps a# running window to its launcher entry — and thus shows the entry's ``Icon=`` on# the taskbar/dock — only when the window's WM_CLASS matches ``StartupWMClass``.-LINUX_WM_CLASS = "personal-jarvis"--def pin_linux_wm_class(name: str = LINUX_WM_CLASS) -> bool:"""Pin the X11/Wayland window-class of subsequently-created windows.@@ -1041,9 +1052,6 @@ def pin_linux_wm_class(name: str = LINUX_WM_CLASS) -> bool:# ``$XDG_DATA_HOME/applications``. The autostart entry under# ``~/.config/autostart`` is a different surface (login launch only) and is# NOT consulted for icon binding or app search.-LINUX_DESKTOP_ENTRY_NAME = "personal-jarvis.desktop"--def _default_linux_applications_dir() -> Path:xdg = os.environ.get("XDG_DATA_HOME", "").strip()base = Path(xdg) if xdg else Path.home() / ".local" / "share"diff --git a/jarvis/ui/relauncher.py b/jarvis/ui/relauncher.pyindex aa8e6dfcfc..4007b811d4 100644--- a/jarvis/ui/relauncher.py+++ b/jarvis/ui/relauncher.py@@ -29,8 +29,10 @@ import threadingimport timefrom pathlib import Path+from jarvis.core.branding import MACOS_APP_DIR_NAME, MANAGED_INSTALL_MARKER+LAUNCHER_MODULE = "jarvis.ui.web.launcher"-MANAGED_MARKER = ".jarvis-managed-install"+MANAGED_MARKER = MANAGED_INSTALL_MARKERPENDING_UPDATE_FILENAME = ".jarvis-update-pending.json"UPDATE_RESULT_FILENAME = ".jarvis-update-result.json"_REVISION_RE = re.compile(r"^[0-9a-fA-F]{7,64}$")@@ -46,7 +48,7 @@ def build_launch_command(executable: str) -> list[str]:"""fallback = [executable, "-m", LAUNCHER_MODULE]if sys.platform == "darwin":- bundle = Path.home() / "Applications" / "Personal Jarvis.app"+ bundle = Path.home() / "Applications" / MACOS_APP_DIR_NAMEtry:from jarvis.setup.macos_app_bundle import (macos_app_bundle_is_launchable,diff --git a/jarvis/ui/shell/single_instance.py b/jarvis/ui/shell/single_instance.pyindex 6ce7af100a..2215adf3d0 100644--- a/jarvis/ui/shell/single_instance.py+++ b/jarvis/ui/shell/single_instance.py@@ -33,11 +33,11 @@ from typing import Anyimport httpx+from jarvis.core.branding import WINDOWS_MUTEX_NAME as MUTEX_NAMEfrom jarvis.core.paths import ensure_user_dirslogger = logging.getLogger(__name__)-MUTEX_NAME = "Global\\PersonalJarvis_v1"SESSION_FILENAME = "session.json"#: POSIX primary-claim lock file (flock'd exclusively by the primary). Distinct#: from the launcher's ``acquire_single_instance_lock`` file so the twodiff --git a/jarvis/ui/web/feedback_routes.py b/jarvis/ui/web/feedback_routes.pyindex 23a8a51ab4..18aa13049a 100644--- a/jarvis/ui/web/feedback_routes.py+++ b/jarvis/ui/web/feedback_routes.py@@ -44,6 +44,7 @@ import httpxfrom fastapi import APIRouter, HTTPExceptionfrom pydantic import BaseModel, Field+from jarvis.core.branding import OFFICIAL_REPO_URLfrom jarvis.core.config import get_secretlog = logging.getLogger(__name__)@@ -69,7 +70,7 @@ _ENV_KEY = "DISCORD_FEEDBACK_WEBHOOK_URL"# Public fallback for every downloader when the operator-only Discord webhook# is not configured (the default — that credential belongs to the project# maintainer, not to the end user running this install).-_GITHUB_ISSUES_URL = "https://github.com/PersonalJarvis/PersonalJarvis/issues"+_GITHUB_ISSUES_URL = f"{OFFICIAL_REPO_URL}/issues"# ----------------------------------------------------------------------diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsxindex 3d74da8365..c8ca0500f6 100644--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx@@ -31,6 +31,7 @@ import { cn } from "@/lib/utils";import { useMemo, useState } from "react";import { useT } from "@/i18n";import { BrowserRealtimeControl } from "@/components/voice/BrowserRealtimeControl";+import { PRODUCT_NAME } from "@/lib/branding";interface NavItem {id: SectionId;@@ -247,7 +248,7 @@ export function Sidebar() {}width={40}height={40}- alt="Personal Jarvis"+ alt={PRODUCT_NAME}className="shrink-0"onError={() => {if (logoRetry < LOGO_RETRY_MAX) {diff --git a/jarvis/ui/web/frontend/src/lib/branding.test.ts b/jarvis/ui/web/frontend/src/lib/branding.test.tsnew file mode 100644index 0000000000..6bf9b6185f--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/branding.test.ts@@ -0,0 +1,21 @@+import { describe, expect, it } from "vitest";++import {+ OFFICIAL_REPO_LABEL,+ OFFICIAL_REPO_SLUG,+ OFFICIAL_REPO_URL,+ PRODUCT_NAME,+} from "@/lib/branding";++describe("branding identity", () => {+ it("keeps the current frontend values byte-for-byte", () => {+ expect(PRODUCT_NAME).toBe("Personal Jarvis");+ expect(OFFICIAL_REPO_SLUG).toBe("PersonalJarvis/PersonalJarvis");+ expect(OFFICIAL_REPO_URL).toBe(+ "https://github.com/PersonalJarvis/PersonalJarvis",+ );+ expect(OFFICIAL_REPO_LABEL).toBe(+ "github.com/PersonalJarvis/PersonalJarvis",+ );+ });+});diff --git a/jarvis/ui/web/frontend/src/lib/branding.ts b/jarvis/ui/web/frontend/src/lib/branding.tsnew file mode 100644index 0000000000..1fd568d910--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/branding.ts@@ -0,0 +1,6 @@+/** Stable product identity values shared by frontend surfaces. */++export const PRODUCT_NAME = "Personal Jarvis";+export const OFFICIAL_REPO_SLUG = "PersonalJarvis/PersonalJarvis";+export const OFFICIAL_REPO_URL = `https://github.com/${OFFICIAL_REPO_SLUG}`;+export const OFFICIAL_REPO_LABEL = `github.com/${OFFICIAL_REPO_SLUG}`;diff --git a/jarvis/ui/web/frontend/src/lib/shareImage.ts b/jarvis/ui/web/frontend/src/lib/shareImage.tsindex 83c16181bf..7499d4daaf 100644--- a/jarvis/ui/web/frontend/src/lib/shareImage.ts+++ b/jarvis/ui/web/frontend/src/lib/shareImage.ts@@ -7,9 +7,14 @@* fallback chain in {@link shareToX}.*/import { toBlob } from "html-to-image";+import {+ OFFICIAL_REPO_LABEL,+ OFFICIAL_REPO_URL,+ PRODUCT_NAME,+} from "@/lib/branding";-export const REPO_URL = "https://github.com/PersonalJarvis/PersonalJarvis";-export const REPO_LABEL = "github.com/PersonalJarvis/PersonalJarvis";+export const REPO_URL = OFFICIAL_REPO_URL;+export const REPO_LABEL = OFFICIAL_REPO_LABEL;export interface ShareStats {userWords: number;@@ -88,7 +93,7 @@ export async function copyImageToClipboard(export function buildShareText(stats: ShareStats): string {const nf = (n: number) => n.toLocaleString("en-US");return (- `I've spoken ${nf(stats.userWords)} words to my Personal Jarvis across ` ++ `I've spoken ${nf(stats.userWords)} words to my ${PRODUCT_NAME} across ` +`${nf(stats.sessionCount)} conversations — ${stats.conversationHours.toFixed(1)} h of voice. ` +`Build your own:`);diff --git a/jarvis/ui/web/frontend/src/views/PluginsView.tsx b/jarvis/ui/web/frontend/src/views/PluginsView.tsxindex ef3863817c..bc90ce1370 100644--- a/jarvis/ui/web/frontend/src/views/PluginsView.tsx+++ b/jarvis/ui/web/frontend/src/views/PluginsView.tsx@@ -22,6 +22,7 @@ import { Button } from "@/components/ui/button";import { cn } from "@/lib/utils";import { openExternalUrl } from "@/lib/openExternal";import { robustCopy } from "@/lib/clipboard";+import { PRODUCT_NAME } from "@/lib/branding";// Wave hero image restored. The previous "kill image entirely" attempt// felt too flat; the CSS-only gradient lacked atmospheric depth. Edge@@ -1415,7 +1416,7 @@ function OAuthRedirectDialog({<Loader2 className="h-8 w-8 animate-spin text-primary" /><div><p className="text-sm font-medium text-foreground">- Authorize Personal Jarvis in your browser+ Authorize {PRODUCT_NAME} in your browser</p><p className="mt-1 text-xs leading-relaxed text-muted-foreground">A browser tab opened for {pluginName}. Sign in if prompted,diff --git a/jarvis/ui/web/launcher.py b/jarvis/ui/web/launcher.pyindex 8a107cdfbe..5851604b58 100644--- a/jarvis/ui/web/launcher.py+++ b/jarvis/ui/web/launcher.py@@ -19,6 +19,8 @@ import signalimport sysimport time+from jarvis.core.branding import CONFIG_FILE_NAME+# Boot-profiling anchor (opt-in via JARVIS_BOOT_PROFILE=1). ``main()`` stamps the# earliest in-process moment our code runs; ``_run_headless`` emits one# authoritative ``BOOT_READY_MS=<n>`` line once the backend is fully serving so@@ -223,7 +225,7 @@ def _fast_admin_port() -> int:repo_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))- path = os.path.join(repo_root, "jarvis.toml")+ path = os.path.join(repo_root, CONFIG_FILE_NAME)if os.path.exists(path):with open(path, "rb") as fh:data = tomllib.load(fh)@@ -249,7 +251,7 @@ def _fast_auth_token_env() -> str:repo_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))- path = os.path.join(repo_root, "jarvis.toml")+ path = os.path.join(repo_root, CONFIG_FILE_NAME)if os.path.exists(path):with open(path, "rb") as fh:data = tomllib.load(fh)@@ -275,7 +277,7 @@ def _fast_vite_dev_url(force_dev: bool) -> str | None:repo_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))- path = os.path.join(repo_root, "jarvis.toml")+ path = os.path.join(repo_root, CONFIG_FILE_NAME)if os.path.exists(path):with open(path, "rb") as fh:ui = tomllib.load(fh).get("ui", {})diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.pyindex f421b6c109..4bcab53c91 100644--- a/jarvis/ui/web/server.py+++ b/jarvis/ui/web/server.py@@ -27,6 +27,7 @@ from loguru import loggerfrom pydantic import ValidationErrorfrom jarvis import __version__+from jarvis.core.branding import CONFIG_FILE_NAMEfrom jarvis.core.bus import EventBus, get_default_busfrom jarvis.core.config import JarvisConfigfrom jarvis.core.events import (@@ -2801,7 +2802,7 @@ class WebServer:That section is NOT in the Pydantic tree (see assumption A-2 in thePhase-7 bootstrap), hence tomllib directly."""- toml_path = Path("jarvis.toml")+ toml_path = Path(CONFIG_FILE_NAME)if not toml_path.exists():return {}try:diff --git a/jarvis/ui/web/socials_routes.py b/jarvis/ui/web/socials_routes.pyindex 85307320fa..395be4e592 100644--- a/jarvis/ui/web/socials_routes.py+++ b/jarvis/ui/web/socials_routes.py@@ -39,6 +39,8 @@ from urllib.parse import urlsplitfrom fastapi import APIRouter, HTTPExceptionfrom pydantic import BaseModel+from jarvis.core.branding import OFFICIAL_REPO_URL+log = logging.getLogger(__name__)router = APIRouter(prefix="/api/socials", tags=["socials"])@@ -72,7 +74,7 @@ def _seed_entries() -> list[dict[str, Any]]:"""raw = [("discord", "Discord", "https://discord.gg/x7USduHxbc"),- ("github", "GitHub (Repo)", "https://github.com/PersonalJarvis/PersonalJarvis"),+ ("github", "GitHub (Repo)", OFFICIAL_REPO_URL),("github", "GitHub (Profile)", "https://github.com/PersonalJarvis"),# X: the project's public X presence. Maintainer directive 2026-07-18:# the former @PersonalJarvis account is defunct; the project posts fromdiff --git a/jarvis/ui/web/surface_security.py b/jarvis/ui/web/surface_security.pyindex 035f4cf265..53e69c853a 100644--- a/jarvis/ui/web/surface_security.py+++ b/jarvis/ui/web/surface_security.py@@ -26,7 +26,9 @@ from http.cookies import CookieError, SimpleCookiefrom typing import Any, Literalfrom urllib.parse import parse_qs, urlsplit-COOKIE_NAME = "jarvis_session"+from jarvis.core.branding import CONFIG_FILE_NAME, SESSION_COOKIE_NAME++COOKIE_NAME = SESSION_COOKIE_NAME_LOOPBACK_HOSTS = frozenset({"localhost", "127.0.0.1", "::1"})_SAFE_HTTP_METHODS = frozenset({"GET", "HEAD"})@@ -78,7 +80,7 @@ def _read_browser_login_required_from_config() -> bool:repo_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))- path = os.path.join(repo_root, "jarvis.toml")+ path = os.path.join(repo_root, CONFIG_FILE_NAME)if not os.path.exists(path):return Falsetry:diff --git a/jarvis/ui/web/update_routes.py b/jarvis/ui/web/update_routes.pyindex 54dc60ba4a..38b44b9a36 100644--- a/jarvis/ui/web/update_routes.py+++ b/jarvis/ui/web/update_routes.py@@ -49,6 +49,12 @@ from typing import Any, Literalfrom fastapi import APIRouter, HTTPException+from jarvis.core.branding import (+ MANAGED_INSTALL_MARKER,+ OFFICIAL_RELEASES_LATEST_API_URL,+ OFFICIAL_REPO_SLUG,+ UPDATER_USER_AGENT,+)from jarvis.core.process_utils import NO_WINDOW_CREATIONFLAGSlog = logging.getLogger(__name__)@@ -58,11 +64,11 @@ router = APIRouter(prefix="/api/update", tags=["update"])# The ONE official public repo this updater will ever pull from. The managed# guard verifies the installed checkout's ``origin`` resolves here before any# ``git reset --hard`` runs, so a dev checkout or a fork can never be self-reset.-_OFFICIAL_REPO_SLUG = "PersonalJarvis/PersonalJarvis"-_RELEASES_LATEST_API = "https://api.github.com/repos/PersonalJarvis/PersonalJarvis/releases/latest"+_OFFICIAL_REPO_SLUG = OFFICIAL_REPO_SLUG+_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 = ".jarvis-managed-install"+_MARKER_NAME = MANAGED_INSTALL_MARKER_PENDING_UPDATE_NAME = ".jarvis-update-pending.json"_UPDATE_RESULT_NAME = ".jarvis-update-result.json"@@ -313,7 +319,7 @@ async def _fetch_latest_release() -> dict[str, Any] | None:_RELEASES_LATEST_API,headers={"Accept": "application/vnd.github+json",- "User-Agent": "PersonalJarvis-Updater",+ "User-Agent": UPDATER_USER_AGENT,},)if resp.status_code != 200:diff --git a/scripts/install_shortcuts.py b/scripts/install_shortcuts.pyindex 76ab9b7d5c..de9ea558c2 100644--- a/scripts/install_shortcuts.py+++ b/scripts/install_shortcuts.py@@ -27,13 +27,22 @@ from pathlib import Pathfrom PIL import Image, ImageDraw, ImageFilterPROJECT_ROOT = Path(__file__).resolve().parent.parent+if str(PROJECT_ROOT) not in sys.path:+ sys.path.insert(0, str(PROJECT_ROOT))++from jarvis.core.branding import ( # noqa: E402 - script source path above+ PRODUCT_NAME,+ WINDOWS_APP_USER_MODEL_ID,+ WINDOWS_SHORTCUT_FILE_NAME,+)+ICON_DIR = PROJECT_ROOT / "assets" / "icons"ICON_PATH = ICON_DIR / "jarvis.ico"RUN_BAT = PROJECT_ROOT / "run.bat"-SHORTCUT_NAME = "Personal Jarvis.lnk"-APP_USER_MODEL_ID = "PersonalJarvis.PersonalJarvis"-DESCRIPTION = "Personal Jarvis — voice-controlled meta-orchestrator"+SHORTCUT_NAME = WINDOWS_SHORTCUT_FILE_NAME+APP_USER_MODEL_ID = WINDOWS_APP_USER_MODEL_ID+DESCRIPTION = f"{PRODUCT_NAME} — voice-controlled meta-orchestrator"# Jarvis launcher module (pywebview window, no console)LAUNCHER_MODULE = "jarvis.ui.web.launcher"@@ -56,9 +65,9 @@ def startup_path() -> Path:def generate_icon() -> None:- """Jarvis-Icon: Matte-Schwarz-Kreis, gelber Signal-Sparkle, sanftes Glow.+ """Jarvis icon: matte black circle, yellow signal sparkle, soft glow.- Design entspricht dem Frontend-Theme (#0A0A0A + #FFD60A).+ The design matches the frontend theme (#0A0A0A + #FFD60A)."""ICON_DIR.mkdir(parents=True, exist_ok=True)@@ -74,7 +83,7 @@ def generate_icon() -> None:draw = ImageDraw.Draw(master)- # Hauptkreis — matte Schwarz mit gelbem Ring+ # Main circle: matte black with a yellow ring.pad = 32draw.ellipse((pad, pad, size - pad, size - pad),diff --git a/tests/unit/core/test_branding.py b/tests/unit/core/test_branding.pynew file mode 100644index 0000000000..ff5cd87f8c--- /dev/null+++ b/tests/unit/core/test_branding.py@@ -0,0 +1,90 @@+"""Freeze the persistent product identity values used by existing installs."""++from __future__ import annotations++import importlib+import os++import pytest++import jarvis.core.branding as branding++_CURRENT_IDENTITY = {+ "PRODUCT_NAME": "Personal Jarvis",+ "PRODUCT_COMPACT_NAME": "PersonalJarvis",+ "PRODUCT_SLUG": "personal-jarvis",+ "CONFIG_FILE_NAME": "jarvis.toml",+ "KEYRING_SERVICE_NAME": "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",+ "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",+ "MACOS_APP_NAME": "Personal Jarvis",+ "MACOS_APP_DIR_NAME": "Personal Jarvis.app",+ "MACOS_EXECUTABLE_NAME": "PersonalJarvis",+ "MACOS_BUNDLE_ID": "com.personal-jarvis.desktop",+ "MACOS_AUTOSTART_LABEL": "com.personal-jarvis.autostart",+ "LINUX_APP_NAME": "Personal Jarvis",+ "LINUX_DESKTOP_ENTRY_FILE_NAME": "personal-jarvis.desktop",+ "LINUX_WM_CLASS": "personal-jarvis",+ "DEFAULT_OFFICIAL_REPO_SLUG": "PersonalJarvis/PersonalJarvis",+ "OFFICIAL_REPO_SLUG_ENV_VAR": "JARVIS_OFFICIAL_REPO_SLUG",+ "OFFICIAL_REPO_SLUG": "PersonalJarvis/PersonalJarvis",+ "OFFICIAL_REPO_URL": "https://github.com/PersonalJarvis/PersonalJarvis",+ "OFFICIAL_REPO_GIT_URL": "https://github.com/PersonalJarvis/PersonalJarvis.git",+ "OFFICIAL_RELEASES_LATEST_API_URL": (+ "https://api.github.com/repos/PersonalJarvis/PersonalJarvis/releases/latest"+ ),+ "UPDATER_USER_AGENT": "PersonalJarvis-Updater",+}+++def test_default_exported_identity_values_are_frozen() -> None:+ previous = os.environ.pop(branding.OFFICIAL_REPO_SLUG_ENV_VAR, None)+ try:+ module = importlib.reload(branding)+ actual = {name: getattr(module, name) for name in _CURRENT_IDENTITY}+ assert actual == _CURRENT_IDENTITY+ finally:+ if previous is not None:+ os.environ[branding.OFFICIAL_REPO_SLUG_ENV_VAR] = previous+ importlib.reload(branding)+++def test_official_repo_slug_override_is_exact() -> None:+ assert (+ branding.resolve_official_repo_slug(+ {"JARVIS_OFFICIAL_REPO_SLUG": "RenamedOrg/RenamedRepo"}+ )+ == "RenamedOrg/RenamedRepo"+ )+++ "value",+ [+ "owner",+ "owner/repo/extra",+ "/repo",+ "owner/",+ "owner/repo evil",+ " owner/repo",+ "owner/repo ",+ ],+)+def test_official_repo_slug_override_rejects_non_exact_values(value: str) -> None:+ with pytest.raises(ValueError, match="exact owner/repository slug"):+ branding.resolve_official_repo_slug({"JARVIS_OFFICIAL_REPO_SLUG": value})diff --git a/tests/unit/install/test_branding_contract.py b/tests/unit/install/test_branding_contract.pynew file mode 100644index 0000000000..a05d76829c--- /dev/null+++ b/tests/unit/install/test_branding_contract.py@@ -0,0 +1,138 @@+"""Keep standalone bootstrap projections aligned with core branding."""++from __future__ import annotations++import re+from pathlib import Path++import pytest++from jarvis.core.branding import (+ CONFIG_FILE_NAME,+ DEFAULT_INSTALL_DIR_NAME,+ DEFAULT_OFFICIAL_REPO_SLUG,+ KEYRING_SERVICE_NAME,+ LINUX_DESKTOP_ENTRY_FILE_NAME,+ MACOS_APP_DIR_NAME,+ MACOS_AUTOSTART_LABEL,+ OFFICIAL_REPO_SLUG_ENV_VAR,+ WINDOWS_APP_USER_MODEL_ID,+ WINDOWS_SHORTCUT_FILE_NAME,+ WINDOWS_UNINSTALL_REGISTRY_SUBKEY,+)++_ROOT = Path(__file__).resolve().parents[3]+++ ("relative_path", "default_pattern"),+ [+ (+ "install/install.sh",+ r"JARVIS_OFFICIAL_REPO_SLUG:-(?P<slug>[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)",+ ),+ (+ "install/install.ps1",+ r"OfficialRepoSlug = '(?P<slug>[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)'",+ ),+ (+ "install/install-verify.sh",+ r'DEFAULT_OFFICIAL_REPO_SLUG="(?P<slug>[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)"',+ ),+ (+ "install/install-verify.ps1",+ r"EXPECTED_REPO = '(?P<slug>[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)'",+ ),+ ],+)+def test_installer_slug_projection_matches_canonical_default(+ relative_path: str, default_pattern: str+) -> None:+ source = (_ROOT / relative_path).read_text(encoding="utf-8")+ match = re.search(default_pattern, source)+ assert match is not None+ assert match.group("slug") == DEFAULT_OFFICIAL_REPO_SLUG+ assert OFFICIAL_REPO_SLUG_ENV_VAR in source+ assert "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$" in source+++def test_quick_install_urls_are_derived_from_resolved_slug() -> None:+ shell = (_ROOT / "install/install.sh").read_text(encoding="utf-8")+ powershell = (_ROOT / "install/install.ps1").read_text(encoding="utf-8")+ assert "https://github.com/${OFFICIAL_REPO_SLUG}.git" in shell+ assert '"https://github.com/$OfficialRepoSlug.git"' in powershell+++def test_verifier_identity_regexes_are_derived_from_resolved_slug() -> None:+ shell = (_ROOT / "install/install-verify.sh").read_text(encoding="utf-8")+ powershell = (_ROOT / "install/install-verify.ps1").read_text(encoding="utf-8")+ assert "${_expected_repo_regex}" in shell+ assert "[regex]::Escape($EXPECTED_REPO)" in powershell+++ ("relative_path", "variable", "quote", "expected"),+ [+ ("install/install.sh", "CONFIG_FILE_NAME", '"', CONFIG_FILE_NAME),+ (+ "install/install.sh",+ "MACOS_AUTOSTART_LABEL",+ '"',+ MACOS_AUTOSTART_LABEL,+ ),+ ("install/install.ps1", "$ConfigFileName", "'", CONFIG_FILE_NAME),+ (+ "install/uninstall.sh",+ "DEFAULT_INSTALL_DIR_NAME",+ '"',+ DEFAULT_INSTALL_DIR_NAME,+ ),+ ("install/uninstall.sh", "MACOS_APP_DIR_NAME", '"', MACOS_APP_DIR_NAME),+ (+ "install/uninstall.sh",+ "LINUX_DESKTOP_ENTRY_FILE_NAME",+ '"',+ LINUX_DESKTOP_ENTRY_FILE_NAME,+ ),+ (+ "install/uninstall.sh",+ "KEYRING_SERVICE_NAME",+ '"',+ KEYRING_SERVICE_NAME,+ ),+ (+ "install/uninstall.ps1",+ "$DefaultInstallDirName",+ "'",+ DEFAULT_INSTALL_DIR_NAME,+ ),+ (+ "install/uninstall.ps1",+ "$WindowsShortcutFileName",+ "'",+ WINDOWS_SHORTCUT_FILE_NAME,+ ),+ (+ "install/uninstall.ps1",+ "$WindowsUninstallRegistrySubkey",+ "'",+ WINDOWS_UNINSTALL_REGISTRY_SUBKEY,+ ),+ (+ "install/uninstall.ps1",+ "$WindowsAppUserModelId",+ "'",+ WINDOWS_APP_USER_MODEL_ID,+ ),+ ],+)+def test_standalone_identity_projection_matches_canonical_value(+ relative_path: str,+ variable: str,+ quote: str,+ expected: str,+) -> None:+ source = (_ROOT / relative_path).read_text(encoding="utf-8")+ assignment = f"{variable} = {quote}{expected}{quote}"+ compact_assignment = f"{variable}={quote}{expected}{quote}"+ assert assignment in source or compact_assignment in sourcediff --git a/tests/unit/setup/test_uninstall.py b/tests/unit/setup/test_uninstall.pyindex 7f591ab523..b7872e61e7 100644--- a/tests/unit/setup/test_uninstall.py+++ b/tests/unit/setup/test_uninstall.py@@ -163,10 +163,10 @@ def test_bootstrap_fallbacks_remove_registration_without_the_venv() -> None:windows = (root / "install" / "uninstall.ps1").read_text(encoding="utf-8")posix = (root / "install" / "uninstall.sh").read_text(encoding="utf-8")- assert "CurrentVersion\\Uninstall\\PersonalJarvis" in windows- assert "Start Menu\\Programs\\Personal Jarvis.lnk" in windows- assert "$HOME/Applications/Personal Jarvis.app" in posix- assert "applications/personal-jarvis.desktop" in posix+ assert "$WindowsUninstallRegistrySubkey" in windows+ assert "$WindowsShortcutFileName" in windows+ assert "$HOME/Applications/$MACOS_APP_DIR_NAME" in posix+ assert "applications/$LINUX_DESKTOP_ENTRY_FILE_NAME" in posixdef test_bootstraps_stop_the_running_app_and_retry_the_delete() -> None:diff --git a/tests/unit/ui/web/test_update_routes.py b/tests/unit/ui/web/test_update_routes.pyindex f29cf96856..2489288b41 100644--- a/tests/unit/ui/web/test_update_routes.py+++ b/tests/unit/ui/web/test_update_routes.py@@ -86,6 +86,20 @@ def test_remote_is_official_accepts_only_exact_repo() -> None:assert not u._remote_is_official("https://github.com/evil/PersonalJarvis.git")+def test_remote_override_still_rejects_lookalike_repos(+ monkeypatch: pytest.MonkeyPatch,+) -> None:+ monkeypatch.setattr(u, "_OFFICIAL_REPO_SLUG", "RenamedOrg/RenamedRepo")+ assert u._remote_is_official("https://github.com/RenamedOrg/RenamedRepo.git")+ assert not u._remote_is_official(+ "https://github.com/RenamedOrg/RenamedRepoEvil.git"+ )+ assert not u._remote_is_official("https://github.com/evil/RenamedRepo.git")+ assert not u._remote_is_official(+ "https://github.com/PersonalJarvis/PersonalJarvis.git"+ )++# --------------------------------------------------------------------------- ## GET /api/update/status# --------------------------------------------------------------------------- #