- install step browser: Chrome for Testing 157 (pinned SHA-256) into runtime/chrome - services start it headless with its own profile when features.browser is on; CDP on a free loopback port passed to the worker as JARVIS_BROWSER_CDP; a failure leaves the services running - every Chrome connection goes through the app's loopback egress proxy: one lookup, public addresses only (403 otherwise, no host logged), QUIC off, WebRTC only through the proxy - stop: Browser.close, then kill after 5 s; dashboard shows the browser's state - the worker's runtime environment follows the settings step, not every step being installed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 KiB
Admin backend spec (v2 M5)
What the management app's screens (docs/v2/desktop-app.md) stand on: the data folder, editing the
settings, the stored secrets and the logs. Plain Rust in the app crate, with no window: the Tauri
shell (M5, later step) only calls these, so every rule here is tested on any OS.
Principles
- One folder. Everything the app keeps lives in the data folder the user chose
(
desktop-app.md, "데이터 폴더 구조"); outside it there is only the file that remembers where it is. - The file stays the user's. Settings edits change only the keys they name, write only values that differ from the default, keep keys the app does not know, and never leave a half-written file.
- Secrets never reach a log, a copy or an export.
- Logs carry no conversation text (already the rule for every log line,
discord_core.spec.md,voice_worker.spec.md); exports still mask secrets.
Data folder (app/src/datadir.rs)
The location file is %APPDATA%\JarvisBot\location.json on Windows and
$XDG_CONFIG_HOME/jarvis-bot/location.json (else ~/.config/jarvis-bot/location.json) elsewhere:
{"dataDir": "<absolute path>"}. JARVIS_DATA_DIR set in the environment wins over it (tests,
development). No location (no file, no variable) means the first-run wizard has not finished.
DataDir::create(path) makes the layout below inside an existing or new folder and returns it; it
never deletes anything. DataDir::choose(path) creates it and writes the location file (atomically).
config/ runtime/ models/llm models/stt models/tts models/vad memory/ browser/ collect/
cache/ logs/ models/hf models/nltk
free_bytes(path) reports the free space of the disk holding the folder (or its nearest existing
parent); the wizard compares it with RECOMMENDED_FREE_BYTES (200 GB) and warns below it. A path
that is not absolute, or is a file, is refused with a message.
Settings editing (app/src/settings_edit.rs)
config/settings.json keeps the format of discord_core.spec.md and conversation.spec.md.
fields()describes every key the screens edit: its dotted path (call.mode), screen (bot,channels,chat,memory,model,features,collect), kind (bool, integer with a range, number with a range, text, text list, choice with its values, Discord ID, Discord ID list, ID to number map, chat channel list, MCP server list, collection target list, free object), its default and a Korean label. The screens are built from this list, so a key is added in one place.view(dir)returns every field's current value: the file's value, or the default when the file does not set it. A file that does not parse is reported, not overwritten.apply(dir, changes)takes{path: value}. Each value is checked against its field; a value equal to the default removes the key (and a section left empty), any other value is set. Keys the app does not know are kept as they were. The whole result must pass the app's own settings check (parse_settings); only then is it written (temporary file, then rename). A refused change names the key and changes nothing.memory(new section): the worker's memory settings (voice_worker.spec.md, "Memory settings":chat,others,off,since_days,recent_minutes,recent_records,matches,budget_tokens), sent in the workerhelloasmemory. Default{}(the worker's defaults).
Features and MCP servers (app/src/features.rs)
docs/v2/desktop-app.md, "기능". The 기능 screen turns the brain's built-in features on and off and
manages the MCP servers it connects.
features(new section):weather(getWeather),webSearch(webSearch,fetchWebPage) andmeals(logMeal,fetchMeals,deleteMeal), each on by default;collect(background collection, below; no brain tool) andbrowser(the bot browser, below "Bot browser"; its brain tool comes with it), also on by default. The tools of a feature that is off go into the brain'sdisabled_tools: they are neither offered nor run (voice_worker.spec.md, "Tools"). The other features of the 기능 screen (PC control, screen viewing) come with their milestone (M7).mcpServers(new list): each{name, command, args, env, enabled}.nameis 1-32 letters, digits,-or_without__(the brain names a server's tools<name>__<tool>), not listed twice;commandis not empty;argsa list of strings;envthe names of the environment variables the server gets (each a letter or_, then letters, digits or_; not listed twice);enabledon by default. Only enabled servers reach the brain'smcps(stdio).- Environment values are secrets (API keys): never in the settings file or
config/brain.json. Each is stored in the secrets asmcp:<server>:<NAME>(mcp_env_set, only for a server and name already saved; an empty value removes it), shown on the screen only as stored or not, and masked in logs like every secret. SavingmcpServersremoves the values of servers and names no longer listed. On start the app passes the enabled servers' stored values to the worker in its environment,JARVIS_MCP_ENV({server: {NAME: value}}); the brain takes that variable out of its own environment and gives each server only its own values. - Each server's outcome (its tool count, or why it failed) is a worker line in the LLM log tab, also without debug logging. MCP servers are programs the PC runs; the screen says to add only trusted ones.
Background collection (app/src/collect.rs)
docs/v2/desktop-app.md, "백그라운드 수집", and docs/v2/pc-features.md. The frame for collecting
sites, search words and RSS feeds on a schedule; there are no targets by default.
collect(new section):keepDays(1-365, default 30) andtargets(default empty), each{name, kind, value, everyMinutes, enabled}.nameis 1-32 letters, digits,-or_(any script; it names the target's folder, so not a Windows device name likeconornul), not listed twice, also not in another case (Newsandnewswould share one Windows folder);kindissite,searchorrss;valueis an http(s) address forsiteandrss(at most 2,000 characters) and the words forsearch(1-200 characters);everyMinutes15-10080 (default 60);enabledon by default.- On every start the app writes
config/collect.json(the foldercollect/,keepDaysand the enabled targets, none withfeatures.collectoff) and passes it to the worker asJARVIS_COLLECT_PATH. Without targets the worker collects nothing but still deletes results older thankeepDays. The worker collects while the services run (voice_worker.spec.md, "Background collection"); results stay incollect/<name>/<YYYY-MM-DD>.jsonlin the data folder only. results(data, target, limit)reads them newest first (the newest day file first, its last line first), each item with itstarget; a name that is not a valid target name is refused, so no other folder is read. Lines that do not parse are skipped.
Secrets (app/src/secrets.rs)
config/secrets.dat holds a JSON object of named secrets (discordToken, the MCP servers'
environment values mcp:<server>:<NAME>). On Windows the bytes are
encrypted with DPAPI for the current Windows user (CryptProtectData, no prompt), so the file is
useless copied to another account or PC. Elsewhere (development only) the file is plain JSON with
owner-only permissions (0600). Writes are atomic. get, set, remove, names; masked(value) shows only
the last 4 characters for the screens (••••abcd).
The app's token comes from the secrets (discordToken), else from JARVIS_DISCORD_TOKEN (tests,
headless runs).
Logs (app/src/logs.rs)
debug_log! and error_log! keep printing to stderr and also feed the log hub once the app
installs one (logs::install). Each line has a time, a level (error, warn, info, debug), a
service tab and its text. The tab comes from the line's category: app, discord (voice,
receive, play, discord), chat, conversation, worker (the voice worker's own lines; its
STT, LLM and TTS lines go to stt, llm, tts by their worker category), browser, capture,
game (the last three from M6-M7). Unknown categories go to app.
- Memory: the last 5,000 lines for the log screen (
query: tab, lowest level, text to find, and the lines after a given sequence number, for live follow). - Files:
logs/<tab>-<YYYY-MM-DD>.log, one line per entry; files older than 14 days are removed at start and once a day. recent_error_report(): the last error with up to 30 lines before and 10 after it (all tabs, in order), the app version and a short PC summary (OS, CPU count, memory);Nonewithout an error. When it is over 2,000 characters (Discord's message limit) the screen offers a download instead.export_zip(from, to, out): the log files of those days in a zip, at most 10 MB (Discord's file limit): when larger, the oldest lines by the time they were logged, across every tab's file, are left out and a note says how many.- Every line runs through
redactbefore it is kept or written to a file, and every copy and export again: each stored secret's value, and anything shaped like a Discord bot token (also with sentence dots around it), becomes[비밀값]. So a secret replaced or removed later never shows on the screen, in a copy, a file or an export, also after a restart. The values masked are the stored secrets and the ones the running services were started with (the bot token, the MCP servers' values;set_secrets_in_useon each start): a key replaced or removed while the services run stays masked in their late lines (the worker and MCP servers keep it until they are restarted), until the next start gives them only the current values. - Errors the voice worker reports to the app (
errormessages: code and request id) are always logged, debug logging or not, so the log screen and the error report show them.
Service control (app/src/control.rs)
The dashboard's start and stop buttons, and the app binary itself, run the services through one
Controller for the data folder: states stopped, starting, running, stopping, failed
(with the error, secrets masked). start from stopped or failed only, stop from running or
starting; restart is stop then start. A start that fails leaves nothing running. A stop while
starting cancels the start (the LLM's model download or load stops and its server is cleared) and
ends in stopped without an error; if the start finished anyway, what came up is stopped again.
The screens' service_start and service_restart return as soon as the state is starting
(restart stops first) and the start runs in the background (the first start downloads the model);
the dashboard shows how it goes, a stop right after the answer cancels the start and a second start
is refused. A stop that cannot confirm everything ended (the LLM's server still answers) ends in
failed with the reason, not stopped; a start (Strata's --restart) can follow. The same goes
for a cancelled start that could not clear the server. Starting reads the
settings and the stored token again, so saved changes take effect on the next start. Each start
gets a new dashboard fed by that run's events; stop ends the feeding (and waits for it) before
the dashboard is forgotten, so an event queued before the stop, or sent by an earlier run, never
reaches the screen.
Dashboard data (app/src/dashboard.rs)
Controller::snapshot() is everything the dashboard shows, as one JSON-ready value:
stateanderror(above);discord: the bot's tag once connected;worker: connected, STT and TTS ready (from the worker'shello_ok), restarts of its process.voice: the voice channel Jarvis is in and the people there (ID and display name), as the core reports them to the worker.captions: live captions, the last 30 lines: a speaker's partial transcript is replaced by their next partial and then by the final. A transcript belongs to the voice session its utterance started in (Heard.session,discord_core.spec.md): only the current session's are shown, so one arriving after Jarvis left, or after it moved to another channel, is not. On the screen only: never logged, never written, cleared when Jarvis leaves the voice channel or the services stop.latency: the last 20 voice answers, each split into its stages: speech end to final transcript, the brain (answer asked to answer text), the voice (answer text to the first sound) and the total; with the median of each. The core'sAnswerAsked { id, user, ended_at, final_at }event carries the speech id and the request's own times (when its speech ended, when its final arrived), so a second question waiting behind the first does not change the first's times.missed: the conversation's missed requests (conversation.spec.md), newest first, at most 20: who, why and how long ago, never the text.system: memory in use and total, and per NVIDIA GPU its use and VRAM (fromnvidia-smi, missing when there is none); sampled when the snapshot is taken, at most once a second.browser: the bot browser's{state, note}("Bot browser").llm: the LLM's state (off,starting,ready,failed), whether the app runs it (managed), and while starting Strata's last line and how far that line says it got (its percentage, orX of Y GBfor the model download; none on a line without progress), also before the services are up; a failure's reason innote.performance: the performance stage (normal, gaming, paused, and why) comes with game detection in M7; until thennull.
The dashboard's state is built from the core's events alone (Dashboard::on_event with the time),
so it is tested with made-up events.
Install (app/src/install.rs, app/src/download.rs)
The wizard's model step installs the runtime into the data folder with the recipe the M0 kit used
on the game PC (scripts/m0). The steps, in order:
| Step | What |
|---|---|
uv |
uv 0.11.20, downloaded with resume and checked against the release's SHA-256, into runtime/uv |
worker_env |
Python 3.12 venv runtime/venvs/worker with src/voice_worker/requirements.txt and requirements-brain.txt (the v2 brain only; the repository's requirements.txt is v1's desktop app) |
melo_env |
Python 3.11 venv runtime/venvs/melo: PyTorch 2.11 cu128 (pinned so later installs keep it), MeloTTS at a pinned commit, python-mecab-ko instead of the Japanese MeCab |
stt_model |
Whisper large-v3-turbo (faster-whisper) |
tts_model |
the NLTK data MeloTTS's English g2p reads, then the worker's own melo_child.py loads the Korean voice once (downloading it) and must say its warm-up sentence |
strata |
Strata's own installer (install.ps1, install.sh elsewhere) with Strata's state, engine and components under runtime/strata and no PATH change |
browser |
the bot's Chrome: Chrome for Testing 157.0.8103.78 (win64, linux64), downloaded with resume and checked against its pinned SHA-256, unpacked into runtime/chrome (below, "Bot browser") |
settings |
voiceWorker in the settings pointed at the worker venv's Python with --melo-python <melo venv> --history memory/history.sqlite --brain (other settings kept); the install is done only once this is written |
The LLM itself (Qwen3.6-35B-A3B, about 23 GB) is downloaded by Strata on its first start (below).
- A finished step leaves
runtime/.done/<id>holding its version (the pin; forworker_enva hash of its requirement files), so later runs skip it and a new pin runs it again. Steps run one at a time; a failure stops the run and the next run starts at that step; cancel stops the running command and every process it started (one process group, a job tree on Windows) or the download, also while a server sends nothing (a download's part file stays, so the next try continues it). - Folders go to commands as arguments or as the working folder, never inside a script's text.
- Every command runs with the layout's environment:
uv's cache and Pythons,HF_HOME(models/hf),NLTK_DATA(models/nltk), temp files (cache/tmp) and Strata's folders (on Windows alsoAPPDATAandLOCALAPPDATA, where Strata and the NVIDIA shader cache write whateverSTRATA_*says), all inside the data folder. Python comes fromuvonly. Output lines go to theinstalllog tab. A line that is not UTF-8 (a Windows PC without the UTF-8 option prints in its code page, CP949 for Korean) is read in the PC's OEM code page, never ending the reading. - Downloads go to
<file>.part, continue with an HTTP range after a break (a server without ranges starts over), and are checked against the pinned SHA-256; a wrong checksum deletes the part. - When every step is done,
uv's download cache is cleaned (the venvs hold copies). - With the install complete, the services start the worker with the same environment (models, caches and temp files in the data folder; on Linux also the CUDA wheels' library folders).
Bot browser (app/src/browser.rs)
docs/v2/pc-features.md, "백그라운드 크로미움으로 정보 수집" and "봇용 크롬창과 디스코드 화면공유". The
bot's own Chrome, in the data folder, driven over the Chrome DevTools Protocol (CDP). This part runs
it in the background (headless); the virtual monitor for screen sharing comes next (M6).
features.browser(브라우저 제어, on by default). With it on and thebrowserstep installed, the services start the bot browser after the LLM and before the worker, and stop it after the worker. Without it (off, or not installed) nothing starts. A browser that does not start is a warning on the dashboard and in thebrowserlog tab; the services run on without it.- Chrome runs with its own profile
browser/profile(--user-data-dir), headless, no first-run, sync, component updates, translation or background networking, and CDP on a free loopback port (--remote-debugging-port=0; the port is read from the profile'sDevToolsActivePort, which is removed before each start, and/json/versionmust answer within 30 s). The worker getsJARVIS_BROWSER_CDP=http://127.0.0.1:<port>. - Egress proxy: every Chrome connection goes through the app's proxy on a free loopback port
(
--proxy-server, and--proxy-bypass-list=<-loopback>so not even loopback is direct; QUIC off, WebRTC only through the proxy). The proxy takesCONNECT host:port(HTTPS, WebSocket) and plain HTTP requests with an absolutehttp://address. It resolves the name once (at most 10 s), refuses with 403 unless every address is public (not loopback, private, link-local, CGNAT, documentation, benchmarking, multicast, reserved or unspecified, also inside IPv4-mapped IPv6), and connects only to those addresses, so Chrome can never reach the PC or the local network. Plain HTTP goes on withConnection: closeand without proxy headers. A request it cannot read is a 400. It logs no host or address, only that it refused one. - Stop: CDP
Browser.close, then up to 5 s for the process to end, else it and the processes it started are killed. The services' stop ends the proxy too. - Dashboard
browser:{state, note}withstateoff, ready, failed (the note says why) or exited (it ended on its own). - Linux (development only): Ubuntu's AppArmor refuses Chrome's sandbox;
JARVIS_CHROME_NO_SANDBOX=1in the app's environment adds--no-sandbox. Windows always runs it sandboxed.
LLM (app/src/strata.rs)
The brain answers with one model, Qwen3.6-35B-A3B UD-Q4_K_XL through Strata (M0). The services start it first, so nothing answers before the brain can, and stop it last.
- Strata from the data folder (the default):
strata launch --family qwen36 --model ud-q4_k_xl --data-dir models/llm --context <llm.context> --vision off --parallel <n> --access local --port <llm.port> --no-api-key --restart --yes --no-tui, run like an install command (the layout's environment,runtime/strataas the working folder, one process group, lines to thellmlog tab). It downloads the model on the first start, starts the engine and returns; the app then waits (up to 30 minutes) until/v1/modelslists the model and takes its id.--restartreplaces a server left with other choices; the same choices are reused.--parallelis 1 (faster on a 16 GB card, M0) and 2 when a chat channel answers every message, so its answers do not wait behind voice answers. Pictures are off until something in v2 sends one. Stopping the services runsstrata launch --stop(ended after 2 minutes, with everything it started) and then checks that the port refuses connections; so does a failed or cancelled start, so nothing half-started keeps graphics memory (each check waits up to 10 s to connect: Windows refuses a closed local port only after about 2 s). Stopped means the port refuses connections (a stop command that fails while it does counts as stopped); a timeout, an error status (a server still loading answers 503) or an answer that cannot be read is not a confirmed stop: the LLM isfailedwith the reason, and the stop or the start reports it. The start's cancel is armed when the controller accepts the start (Host::prepare_start), never by the start itself, so a stop between accepting and running the start cancels it before Strata runs anything. Not installed: the start fails and says to run the install. - A server the app does not start: with
llm.url(an OpenAI-compatible/v1address, in the settings file only) the app starts nothing; that server must list a model within 30 seconds. - Settings:
llm.context(default 32768 tokens per request, 4096-262144) andllm.port(default 8080) on the model screen;llm.url(default none). - The brain's settings: on every start the app writes
config/brain.json(it owns the file):ollama_base_urlthe LLM's/v1,ollama_chat_modelthe listed id,db_pathmemory/jarvis.db,disabled_toolsandmcps(above, "Features and MCP servers"); the worker gets it asJARVIS_CONFIG_PATH. Loading it writes nothing to the home folder.
Chat channel names and topics (app/src/channel_sync.rs)
docs/v2/conversation.md, "채널 이름·주제 반영". A chat channel with syncDiscord (on by default)
keeps its Discord name and topic in step with its name and description:
- Registering a channel fills empty name and description with the channel's Discord name and topic
(
discord_channel_info); an answer that arrives after the ID was changed is dropped. settings_applywithchatChannelsfirst refuses a description over Discord's topic limit (1,024 characters) of a syncing channel, saving nothing. After saving, each syncing channel that is new, or whose name or description changed, is compared with Discord and edited where they differ (a new channel never clears a Discord name or topic with an empty field, also when its edit is retried later). Edits go one at a time, so a later save waits for an earlier one and Discord ends with the later. Discord's form of the name (spaces become-) is written back to the settings so the screen shows it, only while the settings still hold the name that was sent. The results come back insync(appliedwith the name,pendingwith the wait,failedwith the reason) and stay readable withchannel_sync_status.- Discord allows about two name or topic edits per channel in ten minutes. A refused edit is
pendingand tried again by itself after the wait Discord names, with what the settings hold then; saving again while waiting adds no second retry. - Without the Manage Channels permission (or any other refusal) the edit is
failedwith the reason; the app keeps what the user wrote. - The two calls go to Discord's REST API directly with the stored token (serenity's client would wait out the rate limit itself, up to ten minutes).
Admin commands (app/src/admin_api.rs)
AdminApi::call(command, args) is the one entry point of the screens, JSON in and out; errors come
back as Korean messages for the screen. The Tauri shell passes the screens' invoke("admin", {command, args}) to it; the development server (below) does the same over loopback HTTP.
| Command | Does |
|---|---|
app_status |
version, data folder, whether a token is stored, wizardStep; firstRun until the wizard's last step was reached (a stored token alone does not finish it) |
wizard_step {step} / wizard_finish |
remember the wizard step reached / mark it done (needs a stored token); both in config/setup.json |
folder_check {path} / folder_choose {path} |
free space against the recommendation / create the folder and remember it |
pc_check |
OS, CPU threads, RAM, NVIDIA GPUs, the driver version and whether it is 580 or newer, free disk |
token_check {token} |
the bot's tag and IDs, whether the Message Content intent is on, the invite link (REST only, nothing stored) |
token_save {token} / token_status |
store it (masked from then on in logs) / set and the masked form, never the token |
discord_guilds / discord_channels {guildId} |
the bot's servers / a server's voice and text channels, for the pickers |
settings_fields / settings_view / settings_apply {changes} |
the settings editor above; restartNeeded when the services run; sync with the chat channels sent to Discord (below) |
service_start / service_stop / service_restart / dashboard |
the controller and its snapshot; start and restart run in the background, stop also cancels a start |
discord_channel_info {id} / channel_sync_status |
a channel's Discord name and topic / each synced chat channel's last result (above) |
collect_results {target, limit} |
{targets, items}: every target folder with results, and the collected items newest first (target null: every target; limit 1-500, default 100) |
mcp_env_status / mcp_env_set {server, name, value} |
which MCP environment values are stored ({server: {NAME: bool}}, never the values) / store one (an empty value removes it); only for a saved server and name |
install_status / install_start / install_cancel |
the install steps and their state, bytes and last line / run what is not done in the background / stop it |
logs_query {tab, level, find, after, limit} / logs_error_report / logs_export {from, to} |
the log hub; the zip goes to logs/ and its path comes back |
The invite link asks for: view channels, send messages, read history, add reactions, manage
messages, manage channels, connect, speak, voice activity, and the slash command scope; never
administrator. Stored secrets are masked in the log hub from the moment the app finds or chooses
its data folder, and again after each one is saved. The log hub writes to the data folder's logs/ as soon as a folder is chosen
(folder_choose points it there; before that, memory only).
Screens (app/ui/)
Plain HTML, CSS and an ES module, no build step, dark theme after DESIGN.md. All text is Korean.
- First-run wizard (while
firstRun): data folder (free space, warning under 200 GB), PC check, the model to download, Discord bot (token check with the Message Content state and the invite link, then save), server and auto-join voice channel pickers, wake words, then start (which says the first start downloads the LLM). The model step shows the install (each step's state, download bytes and last line; start, cancel, retry) and goes on only once everything is installed. Each step reached is saved, so a reload or a restart resumes at that step; only the last step's start finishes it. A stored token lets the bot step go on without entering it again. - Dashboard: the snapshot every second; while the LLM starts, a card with its percentage and Strata's last line, and stop in the header; the header with start, restart and stop is rebuilt only when the state changes, so a click is never lost to the refresh. Every screen change starts a new generation: an answer that arrives after the user moved to another screen is dropped.
- Settings screens (봇, 채널·호출, 채팅 채널, 대화 기억, 모델, 기능, 백그라운드 수집): built from
settings_fields; only changed fields are sent; the server and voice channel are pickers (choosing another server clears the voice channel and lists only that server's channels); the chat channels are a table with their switches; the bot screen also changes the token; the 기능 screen has the feature switches and one card per MCP server (name, command, arguments and environment variable names one per line, on/off, delete), and for a saved server a password box per environment variable that stores its value on its own. The 백그라운드 수집 screen has the targets (a table: name, kind, address or words, interval in minutes, on/off, delete), the keep days, and the results (the newest 100, filtered by any target that has results, each with its time, title, link and the start of its text shown as plain text). - Logs: tab, level and text filters, pause, live follow (lines after the last seen), "최근 오류 복사" (to the clipboard; over 2,000 characters it suggests the zip), and the zip export by days.
jarvis-admin-dev [--port N] [--ui DIR] [--location FILE] (development only) serves app/ui and
the commands on 127.0.0.1; every command needs the random token it prints (#token= in the page
URL), so other local programs cannot drive it.
Window and Windows build (app/shell/)
jarvis.exe(cratejarvis-shell, Tauri 2 on the WebView2 Windows already has) opens one window with the screens (app/ui) and passesinvoke("admin", {command, args})toAdminApi::call.--location FILEreplaces the default location file (%APPDATA%\JarvisBot\location.json). The window's own browser data (WebView2) goes in the data folder (cache/webview); before the first-run wizard chose one it is a scratch folder in the system temp folder (JarvisBot-webview-<process id>), which WebView2 holds until the process ends, so the next start removes it. Nothing goes under%LOCALAPPDATA%, and%APPDATA%\JarvisBotholds only the location file.- Closing the window first runs
AdminApi::shutdownand closes only when it succeeds: an install in progress is cancelled and waited for (its commands and their children end), the services stop (a start in progress is cancelled and waited for, up to 150 s), and after a failed run what may be left is cleared (Controller::shutdown: the LLM's server stopped and confirmed gone). While that runs the window says so; if it fails the window stays open with the reason, and closing it again quits anyway. Quitting another way (the system shutting down) runs the same shutdown. app/shell/package.sh <folder>builds it on Linux (x86_64-pc-windows-gnu, mingw-w64) and lays outJarvis/:jarvis.exe,WebView2Loader.dllandpython-src/(thevoice_workerandjarvispackages, no caches or specs). The worker's default sources arepython-srcnext to the executable when it is there, else the repository'ssrc/; the install reads its requirement files from the same place. The installer (NSIS) comes later; the folder runs as it is.
Tests
cargo test: data folder layout, location file and the environment override, a refused relative
path, free space; settings view with defaults, apply writing only non-defaults, removing a key set
back to its default, keeping unknown keys, refusing a bad value or a result parse_settings refuses
without touching the file; secrets round trip, file permissions on Unix, masking; log tabs from
categories, query filters and follow, files per day and retention, error report bounds, zip size
cap, redaction of stored secrets and token-shaped text; the controller's state rules with a fake
service starter, a stop while starting (cancelled, or finished and stopped again); the LLM
(launch arguments from the settings and inside the data folder, the second request slot for a chat
channel answering everything, the download percentage, the brain's settings file, a given server
used without Strata, Strata missing, a fake Strata that reports progress, returns, serves and is
stopped, is cancelled during its download and cleared, or fails with its last line, a stop that
fails or hangs while the server still answers, holds connections silently or answers 503 (failed,
not off, also through the controller) and one that fails while the port refuses connections (off);
a stop right after a background start running no launch at all, and the next start not cancelled;
closing the app (the controller's shutdown after a failed stop: clean-up failing keeps it failed,
succeeding stops it; an install in progress cancelled and waited for); command output that is not
UTF-8 read on to the end; the window data folder (data folder, or a scratch folder removed later);
the TTS speed reaching the worker's arguments; features and MCP servers (read and refused with
the key, the feature tools named as the brain names them, only enabled servers in the brain's
settings without values, stored values passed for enabled servers only, values of removed servers
and names deleted, a value refused for an unsaved server, kept out of the settings file and masked
in logs, also by a new app on the same folder, and a value replaced or removed later still masked
in lines written before and in lines the running services print afterwards, until the next start); chat channel names and topics (only new or edited
syncing channels sent, the topic limit refused before saving, Discord's form of the name written
back, a missing permission failing with the reason and the text kept, a rate-limited edit pending
and retried once with the latest text, a new channel never clearing Discord (also on its retry), a
slow first save never overwriting a later one, unchanged ones not edited; through settings_apply
too); a background start that is starting at once, so a stop right after it cancels it
and a second start is refused, also through the admin commands; a failed stop reported as failed; the brain's
config loaded without writing to the home folder, tests/test_config_db_path.py); the dashboard from made-up events (captions replaced and cleared, latency stages
and medians, an answer matched to its asker's final, missed requests without text); the admin
commands (first run: folder then token, the token never returned whole, the wizard resumed at its
step until finished, log files and the zip from the folder choice on, settings and logs through
their modules, the dashboard before anything runs), the invite link's permissions and the Message
Content flags. The screens are checked in a browser against the development server with the real
services (wizard, dashboard start, restart and stop, settings save, chat channels, logs, export). On Windows (the win-ci VM, x86_64-pc-windows-gnu build): the unit tests (DPAPI, data folder,
downloads, install steps, logs; the Unix-only process tests excepted), and the window by hand: the
wizard's folder, PC check and install (uv and the worker venv installed, a cancel leaving no
uv or Python process), the token stored DPAPI-encrypted, a start failing with its reason, the
log screen, error copy, zip export, and closing the window ending the process with nothing written
to %APPDATA% or %LOCALAPPDATA%.