2026-11-04 · Could Kalamu also ship in the Mac App Store?

2026-11-04 · Could Kalamu also ship in the Mac App Store?

Status: study. The maintainer chose to go ahead: see the build.

Context

The macOS decision ruled out the Mac App Store because “its sandbox and running FFmpeg as a separate program do not mix”, and because Kalamu writes its results next to the researcher’s files. From 1.4.0 the GitHub disk image is signed with a Developer ID and notarised (decision), so the maintainer now has an Apple Developer Program membership (team 3HMSG8WB7K). Given that, the maintainer asks whether the store is possible after all.

This record checks each obstacle against the code as it is on main (b756b05), against Tauri’s documentation and source, and against Apple’s documentation and App Review Guidelines, all read on 4 November 2026. The maintainer has no Mac, so nothing here was run in a sandbox. What could not be verified is listed at the end.

Short answer: yes, it is possible. Neither obstacle in the earlier decision is a hard limit. FFmpeg runs as a sandboxed helper that inherits the app’s sandbox, which is Apple’s documented pattern. Writing next to the researcher’s files needs a folder the researcher has granted access to, kept across restarts as a security-scoped bookmark. The real cost is a macOS-only layer in the shell that keeps those grants, a second signed build, and testing on a real Mac.

1. Every path Kalamu stores and opens again later

Under the App Sandbox (com.apple.security.app-sandbox) the app reads and writes freely only inside its container, ~/Library/Containers/io.github.fmadore.kalamu/Data. Outside it, the app can reach only what the researcher hands it:

Either way, access lasts until the app quits. To use a path again after a restart, the app must have made a security-scoped bookmark from it while it still had access, stored it, and then resolve it and call startAccessingSecurityScopedResource at the next launch.

What Where in the code Picked how Used again later Under the sandbox
Data folder: jobs.sqlite, search.sqlite, settings.json, catalog.json, presets/, pipelines/, workflows/, export-profiles/, listening/, snapshots/ src-tauri/src/lib.rs:118-183; platform/macos.rs:38-50 builds it from $HOME/Library/Application Support/Kalamu — every launch Container, no change. A sandboxed app’s HOME is its container’s Data folder, so the same code lands inside it. Paths inside the data folder are stored relative to it (platform/mod.rs:33-36).
Logs platform/macos.rs:47-48, ~/Library/Logs/Kalamu — — Container, no change (same HOME rule).
Whisper models, Tesseract language data lib.rs:184-191: whisper-models/ and tesseract-data/ in the data folder downloaded every offline job Container. Needs com.apple.security.network.client. See point 4 for guideline 2.4.5(iv).
Temporary files (FFmpeg pieces, conversions) std::env::temp_dir() (crates/engine/src/lib.rs:95-97 defaults) — within a run Container (TMPDIR points inside it).
Job sources SourceFile.path, “absolute path on this PC” (crates/core/src/source.rs:46), kept in the jobs.data JSON (crates/store/src/migrations.rs:8) open panel for files (pickFiles, src/lib/tauri.ts:359) or a folder (pickFolder → expand_paths, src/lib/components/FileList.svelte:59, src-tauri/src/commands/jobs.rs:15), or drag and drop (onDrop, tauri.ts:448) resume and retry after a restart (engine.recover(), lib.rs:228); the review’s page images and player (crates/engine/src/listen.rs:65 plays the source itself through the asset protocol); conversion by FFmpeg; writing results again Bookmark per source, or per picked folder, made when the job is created and resolved before engine.recover() at launch. Read-only would do for the sources themselves, but see the output row.
Output folder OutputDestination::Folder(String) (crates/core/src/job.rs:66) in the job; Settings.last_folder in settings.json (src-tauri/src/settings.rs:30) pickFolder (OutputStep.svelte:45) every run and resume; the job’s output list is read from disk (crates/engine/src/output.rs:161-163) and its files opened or shown in Finder (commands/jobs.rs:82-106) Read-write bookmark for the job’s folder and for last_folder.
Results beside the sources (the default, OutputDestination::BesideSources, settings.rs:44; output.rs:249) the parent folder of each source, or of derived_from.original_path (output.rs:243-246) not picked: implied as above Not reachable from a file pick. The open panel grants the picked files, not their folder. Apple’s “related items” mechanism (NSIsRelatedItemType plus an NSFilePresenter) only covers a sibling with the same base name and another extension. Kalamu writes letter.analysis.json, letter.contents.docx and provenance.json (output.rs:230-235, output.rs:116), so it does not fit. In the store build, the folder must be granted once, through an open panel set to the source’s folder (open({ directory: true, defaultPath })) with a line saying why, then kept as a bookmark. Sources added as a folder or dropped as a folder already carry that grant.
Project documents documents.source (crates/store/src/projects.rs:30-36) pickDocuments, a folder (ProjectWorkspace.svelte:163), drag and drop starting a job or a workflow run from the project (RunStart.svelte:140), at any later launch Bookmark per document (or per folder), made when it is added.
Workflow runs steps started later from stored sources (engine.resume_runs(), lib.rs:265) as job sources at launch Covered by the source bookmarks, if they are resolved before resume_runs.
Exports and imports: presets, pipelines, workflows, export profiles, dictionary, descriptions tauri.ts:391-424; ExportDialog.svelte, PipelineList.svelte, PromptsView.svelte, DictionaryView.svelte save or open panel no: used once Powerbox access is enough, no bookmark. Except twin files: the dictionary export writes a CSV beside the JSON (tauri.ts:398), descriptions likewise (tauri.ts:405), and the pipeline record a Markdown file (tauri.ts:412). The save panel grants only the named file. These siblings do share the base name, so related items could cover them. Simpler: ask for a folder in the store build, or write both into one archive.
FFmpeg and ffprobe current_exe()’s folder, Contents/MacOS (lib.rs:192-198) bundled every media job Inside the bundle: readable. Needs its own signing, see point 3.

How to build it so the rest of the code does not change: a macOS-only grant keeper in the shell, in src-tauri/src/platform/macos.rs (with a no-op in windows.rs). It makes a bookmark when a job, a document or the output setting is saved. It keeps the bookmarks as opaque bytes keyed by path, in a file of its own in the data folder. At launch, before recover() and resume_runs(), it resolves them and starts access, and makes a fresh bookmark when one comes back stale. Paths stay strings. The engine, store and projects crates never learn about bookmarks, as AGENTS.md requires. A source whose bookmark is missing (jobs made before the sandbox, see point 5) is reported as a missing file, with a button that asks for the folder again.

Libraries, with their latest versions on crates.io on 4 November 2026:

2. What Tauri 2 offers for App Store builds

Tauri’s App Store guide covers the whole route:

3. FFmpeg and ffprobe under the sandbox

Apple’s own article Embedding a command-line tool in a sandboxed app is exactly Kalamu’s case: a tool built by an outside build system, placed in Contents/MacOS, and started by the app. The tool must be signed with only two entitlements: com.apple.security.app-sandbox and com.apple.security.inherit. It then runs inside the app’s sandbox rather than one of its own. The article warns that adding any other entitlement “can cause problems” and makes the tool crash with a code-signing error. It also says get-task-allow is incompatible with inherit.

Tauri does not do this for you. Its bundler signs every external binary with the app’s entitlements file (crates/tauri-bundler/src/bundle/macos/app.rs collects the sidecars into sign_paths, and sign.rs:53-70 passes the same settings.macos().entitlements to each). Signed that way, FFmpeg would carry application-identifier and the file entitlements but no inherit.

So the store build needs one more step after tauri build:

  1. Re-sign Contents/MacOS/ffmpeg and ffprobe with the Apple Distribution identity, an identifier of their own (-i io.github.fmadore.kalamu.ffmpeg), and a two-key Helper.entitlements file.
  2. Re-sign the app bundle over them with the app’s entitlements. Signing goes from the inside out, and changing nested code invalidates the outer signature.
  3. Run productbuild.

codesign -d --entitlements - … then shows the result in CI. This is a short shell step in the workflow, not code in the app.

Two things this does not settle:

Other parts of the shell under the sandbox:

4. App Review Guidelines that touch Kalamu

From the App Review Guidelines:

5. Moving existing Mac users’ data into the container

Apple’s documented mechanism fits as is: container migration manifest. A container-migration.plist in the bundle’s Contents/Resources with Move = ["${ApplicationSupport}/Kalamu", "${Library}/Logs/Kalamu"] makes macOS copy those folders to the same place inside the container the first time the sandboxed app starts. Because platform/macos.rs already builds its paths from HOME, the copied folder is found with no code change. The bundler places it through bundle > macOS > files.

What does not carry over:

6. What the maintainer must do at Apple

In the Apple Developer portal, under Certificates, Identifiers & Profiles:

  1. Identifiers: register an explicit App ID io.github.fmadore.kalamu for macOS. No extra capability is needed: the sandbox and file access are entitlements, not capabilities.
  2. Certificates: create an Apple Distribution certificate and a Mac Installer Distribution certificate. Both can be made from a certificate request generated with OpenSSL on Windows, as the Developer ID one was. Pack each into a .p12 with the legacy SHA-1/3DES encryption.
  3. Profiles: create a Mac App Store Connect distribution profile for that App ID and the Apple Distribution certificate, and download it (it becomes embedded.provisionprofile). Profiles expire with their certificate.
  4. Optional, for testing on a Mac before review: a Mac Development certificate and a development profile listing the tester’s Mac, or simply TestFlight (below).

In App Store Connect:

  1. Users and Access → Integrations → App Store Connect API: create a key with the App Manager role for altool. Keep the .p8 file, its key ID and the issuer ID.
  2. Apps → New App: platform macOS, the name “Kalamu” (if taken on the store, a subtitle-style name such as “Kalamu for researchers”; availability not checked), the bundle ID above, a SKU, and English as the primary language, with French added as a localisation.
  3. The listing:
    • category Productivity;
    • free, all territories;
    • App Privacy answers (“data not collected”, with providers described in the policy);
    • privacy policy URL;
    • age rating;
    • Mac screenshots (16:10, for example 2880×1800);
    • description and keywords adapted from docs/store-listing.md;
    • export compliance: no non-exempt encryption.
  4. App Review information: contact details, the notes (sample files, the offline route, why models are downloaded, that the catalogue is data), and optionally a test API key.
  5. TestFlight: add a Mac colleague as an internal tester, so each uploaded build is opened on a real Mac before review.

Repository secrets for a store job: the two .p12 files and their passwords, the profile (base64), APPLE_API_KEY_ID, APPLE_API_ISSUER and the .p8 key. Free apps need no paid-apps agreement, tax or banking forms.

7. Effort, a second build, and recommendation

A second build is needed. The store build differs from the notarised disk image in every step that matters:

Both come from the same source and the same workflow: a second macOS job in release.yml building with --config tauri.appstore.conf.json and a cargo feature app-store. That feature changes only platform/macos.rs (grants) and app_info (no support link), and the bookmark layer would also be active in the disk image if wanted. Keep the disk image: it serves researchers who prefer GitHub, and it is the only build that writes beside sources without asking.

Estimate, for someone who knows the codebase:

Work Days
Grant keeper in platform/macos.rs (objc2-foundation), bookmarks at job, document, output-folder and drop time, resolved before recover() and resume_runs() at launch, “grant this folder again” for missing sources 3–5
Results beside sources and twin-file exports: ask for the folder in the store build 1–2
tauri.appstore.conf.json, two entitlements files, migration manifest, helper re-signing, productbuild and altool in CI, the app-store feature hiding the support link 2–3
Explicit notice before the first job sent to each provider (5.1.2(i)) 0.5–1
Portal and App Store Connect set-up, listing, screenshots, review notes 1
TestFlight rounds on a real Mac, and App Review (often more than one round for a first sandboxed app) 1–3 weeks elapsed

That is about two working weeks, plus review time. The schedule depends mostly on how soon a Mac tester can run TestFlight builds.

Recommendation.

Not verified without a Mac