2026-11-08 · Architecture checkpoint after version 1.5.0
Context
Version 1.5.0 shipped to the Microsoft Store with the offline OCR vision models, run by
llama.cpp’s own program on the processor or the graphics processor. A release is the end of a
milestone, and several files had passed ~500 lines since the 4 November
checkpoint. Pull request #136 (offline analyses with Gemma 4) was open
at the same time and rewrites crates/offline (host.rs, llm.rs, vision.rs, llama.rs,
cpu.rs), moves the analysis schema helpers into core/src/structured.rs, and touches
core/src/lib.rs, media/src/lib.rs, the app’s setup.rs and offline and settings commands,
the translation files, state.svelte.ts and the mocks. This checkpoint kept out of those files
so the two branches would not conflict. #136 merged while it ran, with #137 (Whisper on the
graphics processor through a Vulkan helper, which split whisper.rs into whisper/); the
branch was brought up to date and the findings those files held were taken up where still worth
it. What is left is listed below.
Two read-only reviews ran in parallel, one of the Rust workspace and one of the interface. Their findings were checked against the code before being acted on or recorded here.
What holds
- Dependencies point inwards. No new internal dependency since 4 November;
dictionary,projectsandsearchreachstoreandexportonly in their tests; the engine names no provider outside its tests. - The rules. No
unwrap()orexpect()outside tests and start-up, noanyhowbelow the app,cfg(target_os)only inplatform/, keys redacted inDebugand exposed only into requests. - Every trait earns its place.
ProjectStore,DictionaryStoreandSearchIndexhave one implementation each but keep dependencies pointing inwards; the others have a fake for tests or several implementations.
Done in this checkpoint
All behaviour-preserving, except the one bug noted.
- Duplication folded (Rust).
- Howard Hinnant’s date algorithm, written twice (ALTO’s
dateTime, the pipeline record’s date), isTimestamp::utc_dateandutc_date_timein core. - The results’ and the units’ CSV are written through
kalamu_export::table_csv, like descriptions, profiles and the dictionary; the golden files are unchanged byte for byte. - OpenAI’s and Mistral’s batch modules read their output files through one
batch::file_lines. - The engine’s fourteen poison-tolerant locks go through one
control::lock. - The app’s settings and granted folders are written through one
settings::write_json.
- Howard Hinnant’s date algorithm, written twice (ALTO’s
- Off the window’s thread. Exporting a project’s descriptions, which reads every document,
was the last synchronous export command; it runs through
off_thread.ProjectsandDictionaryareClone(they hold onlyArcs) so the work can own them. - The offline engines’ shared host. Whisper, Tesseract and the model manager use
host::lock, added by #136, instead of their own copies; Whisper’s and Tesseract’s idle janitors run through onehost::sweep_idlewith oneIDLE_UNLOAD, each engine keeping its sweep (Whisper waits for the turn and empties its slot; Tesseract drops engines left unused). - Files split.
catalog/src/lib.rs770 → 421 lines (its tests intests.rs).whisper/mod.rs, 1,092 lines after #137, gives its samples, windows cut at pauses and loudest stretch towhisper/audio.rswith their tests (974 lines left, about 680 of them code). - Dead code removed.
Catalog::languages_for,BatchState::is_open,AudioSource::is_video(and the field only it read), and the unusedtimeworkspace dependency. - Interface.
- One
clock()and onesounding()for the audio and video players (pieces.ts). - One
baseName()andpathParts()(paths.ts) for seven copies of “the last part of a path”. - One
pickJsonSave(name)for four identical save pickers, and one source picker underpickFilesandpickDocuments. mayStart(): consent, then the granted folders, the same steps before a job and a workflow run.- The review’s zoom modifier and its written form asked of
platform.ts(zoomsWithWheel,modifier), with tests, rather than tested inSourcePane. - One
.ellipsisrule inapp.cssinstead of eight scoped copies. - The dictionary export’s default file name goes through the translation files
(
dictionary.fileName), and three strings nothing read (app.tagline,pipeline.analysisSource,review.aiText) are gone. - Bug: closing New job or a project before the drop listener was registered left it
registered, so a later drop reached a screen that was gone.
listenWhileMounted()removes it, as project search already did by hand, and project search now uses it too.
- One
Accepted
projects/views.rskeeps its own job loader. It loads each job’s pieces and corrections as well; built onTiedResultsit would clone every job to save about eight lines.- Whisper keeps its own processor check.
cpu::ensure, from #136, writes “which {engine} need” for the plural engines; Whisper’s sentence (“offline transcription needs”) would change. ProjectError::Exportstays a string. Animpl From<ExportError>would remove one wrapper in the app, whiledescribed.rsuses the same constructor for serde errors.PipelineDiagram.svelte(935 lines) stays one illustration: the script is 78 lines, the rest is the drawing and its CSS.- Files near 500 lines that are one screen or one concern stay:
core/units.rs,core/analysis.rs,prompts/defaults.rs(preset text),prompts/record.rs,engine/compare.rs,offline/tesseract.rs,SourcePane,ProjectSearch,ContentsReview,AllJobs.
Left for later
What the merged files hold
- FFmpeg’s and llama.cpp’s helpers.
quiet()(no console window) and the lookup of a bundled program (environment variable, the app’s folders, thenPATHin debug builds) are written inmedia/src/ffmpeg.rsandoffline/src/llama.rs: export both frommedia, whichofflinemay depend on. cfg!(windows)below the app:llama.rs’slocate_vulkanandlocate_opencltest the system; drop the tests (those programs are bundled only on Windows and the file check fails elsewhere), or have the app say which builds exist.- The four tests that write a JSON file for the interface (
core/src/lib.rs,engine/src/rules.rs,search/src/fold.rs,search/src/terms.rs) repeat “write only if changed”: one helper behind a test feature of core. timed_lines(reading[hh:mm:ss]markers into segments) is a shared reading of stored results that the engine reaches intoexportfor; it belongs in core.- Sizes:
offline/src/vision.rs(836 lines:placeholder,groundedandwithout_runawayintovision/answer.rs),offline/src/llm.rs(845) andllama.rs(560), each reviewed with the offline host in mind. - The file picker’s extensions (
tauri.tsEXTENSIONS) restateInputKind::from_pathand have drifted:.aiff/.aif,.wmv/.m4vand.xlsxare read by the engine but hidden by the picker. Write each kind’s extensions intocoreLists.json, with the export formats that need a layout (newJob.tsLAYOUT_FORMATS) and the tasks that write text (ProjectSearch’sGENERATED_TASKS). A fix with a visible effect, so a change of its own. tauri.ts(551 lines): the pickers and native questions intodialogs.ts, withstate.svelte.ts’s imports.mock.ts(769 lines): settings, presets and pipelines intomockPresets.ts, the job and review commands into ajobCommand, andmockViewintomockViews.ts, as profiles and projects already are.- Reader sort order is written several ways (
jobList.ts,projects.ts,activity.ts,SetupList, the collators ofglossary.ts,languages.tsandOfflineModels): onereaderOrderini18n/index.ts, keeping each variant’s options.
The rest
- Interface splits that keep behaviour:
NewJob.svelte(828: the set-aside notice, the reading options and the estimate into their own files),newJob.ts(527: model choice intonewJobModels.ts,warningTextanddurationintofileNotes.ts),ReviewView.svelte(661: the open readings intoreadings.svelte.ts, the text splice ofuseReadinginto a testedwithReading()),ProjectWorkspace.svelte(its sections and edit form), andSetupList.svelte(aSetupCardper draft). - Shared interface code not yet used everywhere: the
Actionwrapper inStepBanner,UseTextMenu,WorkflowEditor,WorkflowList,ProjectList,RunStart,SpeakerList,ReviewQueue, and as a toast inAllJobs,JobMenu,LanguagePicker,SetupListandSettingsView; oneContextMenuforJobMenuandItemMenu; one combobox for the two language pickers;profiles.ts’smovedinFieldsEditor. - From the 4 November checkpoint, still open: Whisper’s voice detection on accented data folders on Windows, the folders out of reach shown at launch, Tesseract’s drawing resolution in provenance and its engines pooled.
Consequences
- AGENTS.md is unchanged: its crate table lists what a crate may depend on, and
offlinewill usemediafor item 1. - The roadmap’s first item points to this checkpoint and what it left.