2026-11-10 · The shell
Context
The review of 9 November left the shell untouched (#148): it does not build on Linux, where the review ran, and the second round left it for the same reason. This entry takes up what the issue found, each finding read in the code first. It was written on Linux too: the crates below the shell were built and tested there, and the shell’s pure parts (settings, the start-up message, the keychain cache) were compiled and tested in a stand-in crate that includes their files; the shell itself is first compiled by this pull request’s CI.
Decisions
- A launch that cannot finish says why, then ends. Tauri runs the app’s setup inside the
event loop’s first event and panics when it fails, so a full disk or a damaged
jobs.sqliteleft no window, no message, and a line in a log nobody knew of. Setup now sorts what stopped it into four causes (the data folder, the job database, a job database from a newer version, the saved libraries), logs it, writes the log out, hides the window, shows a native message naming the cause in plain words with the technical detail and the logs folder, and exits once it is closed. The message is the system’s own (a task dialog on Windows, an alert on macOS) throughrfd, called on the main thread: the dialog plugin’s blocking calls wait for the main thread, which setup is on.rfdis the version and features the plugin already builds (0.17.2; 0.18 is out), so nothing new is compiled. - The start-up sentences are the one text the shell words itself. Every other sentence comes
from the interface’s translation files, which do not exist before the webview. The few
sentences are kept in
src-tauri/src/start_failure.rs, in English and French, chosen from the system’s languages by the interface’s own rule (resolveLocale); adding a language to the interface adds it there too. - The store refuses a newer database.
SqliteStore::openapplied the migrations it knew and ran on a database another version had migrated further, which could misread or lose what that version added.user_versionabove the migrations this build has is nowStoreError::Newer { found, known }, and the file is left as it was. - Unreadable settings are moved aside, not overwritten.
settings.jsonthat cannot be read or understood was silently replaced by the defaults at the next save. It is now renamed tosettings.json.bad, or the first free ofsettings.json.2.bad,.3.bad… when an earlier one is there, so no earlier file is lost; the launch goes on with the defaults, the log says so, and the interface says it once (a failure toast, which stays until dismissed) with the path as File Explorer or Finder shows it. Nothing is left in its place, so the next launch is silent. - The keychain is read off the window’s thread, and only an answer is kept.
key_statuswas a synchronous command, run on the window’s thread, reading each provider’s key: on a Mac a Keychain prompt froze the window. It is now async, asset_api_keyis. The cache keptNonefor a read that failed (a locked keychain, a prompt refused), so the key looked missing until the app restarted; it now keeps a key or the keychain’s “no such entry”, and asks again after a failure, logged with the provider (never the key). - An exported record’s Markdown never replaces a file the export did not write. The save
dialog asks before replacing
name.json; nobody asked aboutname.mdbeside it. The Markdown goes toname.mdwhen it is free or holds an earlier export (a title, then A Kalamu pipeline, exported on or A Kalamu workflow (version), else to the first ofname (2).md,name (3).md… that is; the command returns where it went and the toast names it. Exporting a workflow now asks the Mac App Store’s build for the folder first, as exporting a pipeline already did: macOS grants the picked file, not the folder the Markdown goes to. - Release builds run only the programs they ship with.
KALAMU_FFMPEG_DIRandKALAMU_LLAMA_DIRwere honoured in release builds, so an environment variable chose the programs run on a researcher’s documents. They are read in development builds only, asPATHalready was. No workflow sets them; the ignored smoke tests andcargo run --example liverun in debug builds. - Clearing unused results is offered in Settings › General, on the engine’s
prune_results: a sentence on what it does and what it costs (an answer removed is paid for again if asked for again), a plain button disabled while a job runs (the database is held while it is compacted), the native question first, and the result in a toast with the count and the size in the interface’s language. The command refuses too while a job runs (app.jobs_running). - The installer’s and disk image’s copies are told of a newer release. The catalogue gains
an optional top-level
latest_version;Catalog::newer_releasecompares it with the running version as semantic versioning orders them (a pre-release before its release) and gives the release’s page, made from the number after checking it is three plain numbers, so nothing fetched becomes a link. The shell answers nothing for a copy a store updates: the Microsoft Store’s package (known by itsWindowsAppsfolder) and the Mac App Store’s sandboxed build (platform::updated_by_store, one item per system), since a Store app must not offer its own updates. The interface shows a quiet line at the sidebar’s foot, hidden for that version once dismissed (kept in the webview’s storage), and a line in Settings › About; both links open in the browser through the opener. The catalogue refreshed at start-up now tells the interface (catalog-changed), which read it before the answer came. Nothing new is fetched: the same file as before. The bundled file names 1.5.0, the latest release; a release step sets it (andupdated, without which installed copies keep their own file) once a release is public. - A month of logs.
rolling::dailynever removed a file; the appender is now built withmax_log_files(30)(tracing-appender 0.2.5), under the same names (kalamu.log.2026-11-10). It prunes at launch and at each new day, only files namedkalamu.log.*;panic.logis kept. A log folder that cannot be opened no longer panics: the app runs without a file log. strip = trueis kept, for now. It strips the symbol table as well as debug information, sopanic.log’s backtrace on a Mac names no function.strip = "debuginfo"would keep the names (no file or line, since release builds have no debug information) at the cost of the symbol table’s size, which was not measured. On Windows it changes nothing: the names live in a PDB, which the installer does not ship either way. To decide with the macOS build’s size from CI in hand.
Done
crates/store:StoreError::Newer, checked ininit, with a test that a database migrated past this build is refused and left as it was.crates/catalog:latest_version,Version,Release,Catalog::newer_release, tested (ordering, what is a release, the link, the bundled catalogue never newer than the build).crates/prompts:markdown_beside, tested on files, and the two records’ first lines checked against what it recognises.crates/mediaandcrates/offline: the variables read in development builds only.crates/core:PrunedResultsexported to TypeScript.- The shell:
start_failure.rs;setup.rs(the causes,fail, the log appender, the catalogue event);settings.rs(loadandset_aside_name, with tests);secrets.rs;commands/keys.rs;commands/pipelines.rs,workflows.rsandmod.rs(write_record);commands/settings.rs(newer_release,clear_unused_results,settings_set_aside);platform/windows.rsandmacos.rs(updated_by_store); the two commands registered, listed and granted. - The interface: the Stored answers section, the release line in the sidebar and in About, the
settings toast, the exports’ toasts, English and French; the mock answers the new commands
(
?release,?set-aside,view=settings-general,settings-about). - The privacy policy, with a new effective date: the release named in the catalogue, settings moved aside, a month of logs, clearing unused results.
Left
- The tray, the taskbar and the notifications computed by the engine (#148): they still follow the interface’s job list, so a window that is not drawn (hidden, or its webview stopped) leaves them stale. Larger than this round.
- A launch that fails before setup (Tauri’s own
build, a missing WebView2) is still only logged.
To check
On a real Windows PC and a Mac, the Mac App Store’s build among them:
- The start-up message, by making
jobs.sqliteunreadable (a folder of that name), and by raising itsuser_versionpast the build’s: the message’s language, its text, the logs folder it names, that the window does not stay and the process ends. On a Mac with no window shown, that the alert comes to the front. - A
settings.jsonwith a syntax error: the toast, the.badfile, the defaults in use. - Settings › API keys with the Keychain locked or its prompt refused: the window stays responsive, and the key shows as saved once the Keychain is unlocked, without a restart.
- Exporting a pipeline and a workflow beside a
name.mdof one’s own, in the Mac App Store’s build too. - Clear unused results on a large database: the time it takes, the toast’s numbers.
- The release line on the installer and the disk image with a catalogue naming a newer version, and its absence in the Microsoft Store and Mac App Store apps.
- The log folder after a month: thirty files.
Consequences
- AGENTS.md is unchanged.
rfdjoins the shell’s dependencies on Windows and macOS only, at the plugin’s version. - The release steps in development.md gain one: set
latest_versiononce the release is public. - DESIGN.md records the release line.