The MVP is feature-complete. A series of internal audit rounds found and fixed every Critical,
High, and Medium finding plus the actionable Lows (their full reports and disposition ledgers live
in git history and in the architecture.md design records). What remains below are the
consciously-accepted product/architecture decisions and inherent limitations.
Security & privacy
The encrypted-workspace limitations — a decrypted working copy on disk while unlocked, pre-unlock
log lines buffered in memory only (lost on a kill before unlock), best-effort shredding on SSDs, no
password recovery — are documented in
security-model.md ("Threat notes / known limitations"). In addition:
The offline guard is detection-only and Node-socket-scoped. It wraps
net.Socket.prototype.connect, logs remote connection attempts made while the app is offline (asked
at each connect, #758), and never blocks (blocking app-wide risks breaking loopback IPC and the
sidecars). It sees sockets as they open, not each request on a kept-alive one. Electron's own net
module would bypass it. The offline guarantee is a property of the code + CSP + deny-by-default policy; the guard is
a tripwire, not an enforcement layer.
A system-wide llama.cpp config file on Linux and macOS still reaches the engines (#730). The
engines start without the host's LLAMA_* variables and with their config lookup redirected
(security-model.md "The engines do not inherit the host's llama.cpp settings"), but llama.cpp
also reads the fixed path /etc/llama.cpp/config.ini, which no variable moves. Only an
administrator can write it. Such a file could also switch on --connect (v0.8.0+), which then
finds a llama-connect only if the host put one on its PATH: the installers never put it on the
drive (#729, security-model.md; one already on a drive is removed by fetch-runtime or the next
engine install, and a Kit holding it fails the sell gate). Windows has no such fixed path. On Linux the redirect has one side
effect: the Vulkan loader reads user-level layers from $XDG_CONFIG_HOME/vulkan too, so layers
installed under ~/.config/vulkan (overlays, capture tools) no longer load into the engines.
Layers and drivers under ~/.local/share and /etc still do.
In-app spell-checking is off by design (#239, #567). Chromium's spell checker downloads a
Hunspell dictionary from a Google-operated CDN for the computer's language, a browser-process
fetch that neither the CSP nor the offline tripwire above can see, and one the offline hard rule
forbids. So the composer shows no red underlines (spellcheck: false on every window), and every
session's checker is switched off with an empty language list (#567). Builds up to v0.1.62 still
downloaded the dictionary at start: on Linux for every language, on Windows for a language
Windows cannot spell-check itself. Re-enabling needs dictionaries shipped on the drive and copied
into the profile before start (owner decision #218; security-model.md "Chromium background
fetches").
importDocuments picker imports are token-bound; drag-drop trusts caller paths (accepted).
A PICKER import is bound to a one-time pickDocuments capability token (main imports exactly what
it returned), so a compromised renderer can't forge a picker-origin read of an arbitrary file
(security-model.md D1). A native OS drag-drop is delivered to the
renderer, so main can't tokenize it — that seam still accepts raw paths but rejects symlinks and
canonicalizes them; the read content has no unattended network sink (offline; a link open
needs your confirmation, #236), but the path can be one
on Windows — a UNC path reaches lstat before any lexical check, which makes Windows attempt an
SMB connection to the named host and, where that host is reachable and outgoing NTLM is not
restricted, a credential exchange (documented behaviour, not probed; an accepted residual —
owner decision #222 declined the lexical rejection on 2026-09-03, #240; see
security-model.md "Residual egress channels").
Some things live or pass outside the drive by design. Display preferences (the language, a
few collapsed-panel states) sit in the host browser profile under the app's OS app-data folder,
not in the workspace; text copied with a Copy button goes to the OS clipboard like any copied
text and is never cleared by the app (owner decision #227, 2026-09-03: document only); a link
opened from an answer or a model manifest opens in the OS browser once you confirm the dialog
that names its site (#236) — the site then sees your IP address. See security-model.md
"What lives or passes outside the drive" and "Residual egress channels" (#249, #250).
Do not drop network-share paths into the app (#240; owner decision #222 — declined
2026-09-03; a permanent limitation). A UNC path reaches lstat before any lexical check
(the drag-drop bullet above), and the app will not reject such paths lexically because that
would change the drop contract for network-share users. Managed Windows fleets can block
outbound 445/WebDAV at the host firewall.
On Windows, the file picker cannot open a file whose name ends in a space or a dot (#918). The
Open dialog lists notes.txt under "All files" but cannot open it (an OS limit; a typed path
loses its trailing space). Drop the file onto the app or import its folder instead.
A large drop is slow on a fully busy machine (#934). Checking a drop of up to 512 paths asks the file system once per path; when every CPU is busy with other work, that can take seconds instead of a fraction of a second. Nothing is lost, and the import carries on.
Quit the app before shutting down or logging off, above all on macOS (#248, #964, #977). On
Windows the app locks the workspace itself as the session ends (PR #285). On Linux it does the
same when a log-out, a shutdown or a kill ends it (#964): a termination signal (SIGTERM,
SIGINT or SIGHUP) or a lost session locks the workspace at once and ends the app, with no
question. On macOS a termination signal does the same (#977): kill, killall, launchctl stop, a forced restart (sudo shutdown -r now, or one a management tool starts) or Ctrl+C in a
terminal. Before, such a stop was an ordinary quit that the question about unsaved review
changes could hold until the system killed the app, unlocked. Quit from the menu, the keyboard
or the Dock, and a log-out, are not signals and work as before (what Activity Monitor's Quit
sends is not checked yet). All of these are best effort: a
very large workspace may not finish locking in the time the system allows, and a review change
made in the last second, a reply still being written or a scan still being read is not kept, so
quitting first is still the sure way. On Linux a log-out usually arrives as a lost session, and
then Electron gives the lock a fixed 10 seconds: a lock that takes longer ends in a crash
(status 133). The lock writes about twice the workspace's size (measured on a USB 3 stick that
writes about 41 MB/s: 3.3 s for 58 MB, 15.5 s for 304 MB). So on that leg the lock now stops
overwriting the unencrypted working copy when its time runs short (8.5 s) and deletes it
instead (#982): the workspace still ends encrypted up to about 9 seconds' worth of writes
(measured on that stick: up to about 320 MB at 41 MB/s, which scales to about 155 MB at 20 MB/s
and 78 MB at 10 MB/s; before, about 175, 85 and 43 MB), and the copy is overwritten in full up
to about half that (measured: about 170 MB at 41 MB/s; about 83 and 41 MB). The part not
overwritten stays on the stick as deleted data that recovery tools may read (on flash an
overwrite may not reach every block anyway). A larger workspace
still crashes there and is left unencrypted on the
drive until the next start, which recovers its data as after any lock that was cut short. The
app does not use logind's shutdown signal, which would lock before a poweroff or a reboot but
never before a log-out (#982). Where the system keeps crash dumps
(systemd-coredump, apport, WSL), such a crash could store a memory image of the app, vault key
included, on the computer's disk. The app's main process, which holds that key, now tells Linux
to leave its memory out of a crash dump, and the helper programs it starts (the model engine,
speech recognition, the knowledge-pack server) inherit that (#982; measured under WSL with a
stand-in app: the dump shrank from about 785 MB, with a planted test string in it, to 164 KB
with no trace of it). A dump can still name the files the app had open and hold the start of
its command line. The processes that draw the app's windows are not covered: their dump can
still hold the password typed on the lock screen, which opens the workspace, what they showed,
and, for the hidden windows that read scans and print evidence packs, document pages that were
never shown. A signal (kill,
systemctl stop, Ctrl+C) has no such limit. Lock first, or quit, before you log out with a
large workspace. The Linux legs are
measured on Electron 43.8.6 under WSL with a stand-in app (the three signals, a lost D-Bus
session bus, a lock slowed to 8, 12 and 15 seconds); a real desktop log-out (GNOME, KDE), a lost
display and the packaged AppImage are not checked yet. The macOS signal leg runs the same code,
and Electron's source shows it reaches the app the same way; it is not yet checked on a Mac
(#887, #888). A forced kill (SIGKILL) or SIGQUIT (Ctrl+\ in a terminal) still loses every change
since the last Lock now or normal quit: nothing runs before the process ends. On macOS the
shutdown leg is registered but not yet verified on a Mac (owner live check,
#226), so quit first there (user-guide §13; security-model.md "OS session end locks the
workspace"). By Electron's source the app locks and quits at a macOS shutdown even when another
app then cancels it (not yet checked on a Mac). If the app ever stays open after a cancelled
shutdown, a click on its Dock icon or into its window shows the unlock screen, and after you
unlock it works as after a start (#1002); until then a quit, a second shutdown or a kill locks
the workspace at once (#977). Wait for the window to close before you eject.
On Linux, the AppImage can run without Chromium's sandbox. The app's windows are configured
sandbox: true (window-security.ts), but the operating-system sandbox behind that setting
needs unprivileged user namespaces, which Ubuntu 24.04 and later restrict by default (as do some
hardened distributions). The AppImage's start script (AppRun, generated by electron-builder)
tests for them with unshare -Ur true and, when that fails, starts the app with --no-sandbox
instead of letting it abort. The AppImage's own .desktop entry passes --no-sandbox
unconditionally, so a desktop shortcut built from that entry starts the app unsandboxed even
where the namespaces are available. Measured on the v0.1.62 AppImage (2026-10-01) in an Ubuntu
24.04 container without user namespaces: the main process, the zygote and the renderers all ran
with --no-sandbox and the app stayed up. Not yet repeated on a stock Ubuntu 24.04 desktop,
where AppArmor rather than seccomp imposes the restriction. What is lost is the operating
system's containment of a compromised renderer process; context isolation, the CSP, the
navigation guards and the deny-by-default permissions are unaffected. Windows and macOS are not
affected. Build detail: packaging.md "Portable build".
Display preferences reset once, on the update that moved the app to its own scheme (#560;
owner decision 2026-10-03: accepted). The app's pages moved from file:// to
hilbertraum://app/ so that a script in a window can no longer read arbitrary local files
(security-model.md "The app's own scheme"). The browser keeps preferences per origin, so on the
first launch after that update: the unlock screen follows the operating system's language until
the first unlock applies the language from Settings again, and the chat list, the Documents side
rail and its "more locations" list open in their default state. Nothing in the workspace is
affected. The values could not be carried over: once the packaged build turns
GrantFileProtocolExtraPrivileges off, a file:// page cannot read its storage at all
(measured), and parsing Chromium's storage files directly was not worth it for four UI
preferences. The old values stay unread in the host profile ("What lives or passes outside the
drive").
The custom scheme and the packaged fuses are measured on Windows and on a Linux AppImage, not
run on macOS (#560, #562). The real AppImage of the #562 build ran in an Ubuntu 24.04 container
with everything as on Windows except one thing: Linux has no check of the program archive
(packaging.md "Platform verification of the app scheme and the fuses"). No Mac was available.
The macOS build was inspected but never started: its fuses, its Info.plist archive hash, and
the ad-hoc signature that GitHub's Mac runner verified. On macOS, flipping a fuse invalidates the
ad-hoc signature of an Apple-silicon binary; the build re-signs it right after
(resetAdHocDarwinSignature), and the release workflow signs it ad hoc again. A Mac owner can
run scripts/verify-mac-build.sh (packaging.md "Verifying a packaged build on macOS").
A Developer ID build, signed with the hardened runtime, is expected to refuse dictation's
microphone until com.apple.security.device.audio-input is added to the entitlements. This is
unverified; the current ad-hoc build is not affected.
The app checks its own program archive, but not all of its program files (#562). A packaged
build stops with "ASAR Integrity Violation" if a byte of its main program archive (app.asar)
has changed. The OCR engine's files sit beside that archive, unpacked, because its worker cannot
read from inside it, and they are not checked: a changed OCR worker still runs (measured). The
check exists only on Windows and macOS; Linux has none. macOS is unmeasured. Someone who can
change the app's files can usually replace the app outright, so this narrows a local attack; it
does not prevent it.
The released app ignores NODE_EXTRA_CA_CERTS (#564). Antivirus products that inspect
encrypted connections (Norton, measured) and corporate proxies set this variable so that programs
trust them, and they also add their certificate to the operating system's certificate store. The
app's built-in downloads trust that store, so they work on such computers without the variable.
A proxy whose certificate is only in the variable, and not in the operating system's store,
makes the downloads fail: add the certificate to the store (your IT department does this for a
company proxy). Trusting the store also means that an older root certificate Windows still trusts
but Chrome no longer does (Entrust, old DigiCert, VeriSign, Go Daddy roots) is trusted, and so is
a self-signed CA certificate in the store for intermediate certificates or for trusted people,
which Windows itself does not treat as a root. A program running as the user can add one there
without the confirmation Windows shows for a new root, much as it could set
NODE_EXTRA_CA_CERTS before. See
troubleshooting.md, "Downloads fail on a company network or behind antivirus".
That cannot change what a download installs, because every engine, model and OCR file is checked
against a fixed SHA-256 checksum before use. A development build (npm run dev) still reads the
variable.
Archive extraction trusts verified archives.fetch-runtime rejects extract_to escapes,
and archives are SHA-256-verified before extraction — but member paths inside an archive are only
as trustworthy as the pinned hash in runtime-sources.yaml.
The single-instance guard is userData-scoped, not workspace-scoped (#208).app.requestSingleInstanceLock() refuses a second app instance on the same userData —
which covers the incident class (two portable release builds, or two runs of the same
build), and dev builds keep their own -dev suffix. It does NOT cover two processes with
differentuserData pointed at one drive workspace: two user accounts on one computer
(fast user switching), each starting the app from the same drive, since userData lives in
each account's own profile (found in #876's analysis; the one case an ordinary user can
reach), or an npm run dev with HILBERTRAUM_DRIVE_ROOT racing a portable exe launched from
that drive. In that corner
the second instance's startup sweep can still destroy the live session's working file
(its delta since the last lock); the lock-path database guard then refuses to
re-encrypt the garbage, so the at-rest .enc — the vault itself — survives and the next
unlock recovers the last locked snapshot. Since #876 the guard judges the file's structure,
not only its 16-byte header: on Windows the lock's own checkpoint can write page 1 back over
the noise, which the header check let through. Its residual: the probe reads the schema, the
root page of every index and the paths down to the first and (for a rowid table) the last row
of every table, a small part of a large file. It catches an overwrite that starts at the
beginning of the file (the #208 shape: none missed in the review's fuzz) or runs to its end,
but mostly misses noise confined to a range or a single page in between (a failing stick's
garbled blocks, another tool's partial rewrite), as the header check did; such a file is then
encrypted over .enc, and the damage shows when the app next reads those pages. On macOS and
Linux the sweep deletes the file
instead of overwriting it; since #853 the refused lock no longer re-creates it as an empty
database, which a retry or the quit used to encrypt over .enc, and since #855 it finishes at
the last locked snapshot and the lock screen says the session's changes are lost. A
workspace-level cross-process lock file would
close the corner fully; not built (stale-lock handling on hard-killed processes needs its
own design). A pre-0.1.59 build takes no lock at all: the drive launchers refuse to start
while two app versions sit at the drive root (#235), but starting an artifact directly
bypasses the launcher, and a signed current-release manifest at the root is an open owner
decision (#220). Since PR #289 the workspace database is stamped with a schema version
(#247), so a build newer than that PR refuses a workspace written by a still-newer one
instead of opening it — but every build up to 0.1.59 ignores the stamp, so an old artifact
from that line still opens a newer workspace silently; delete old artifacts as the update
procedure says.
A pre-envelope build cannot open a v2 (envelope) vault. New vaults — and any vault after
its first password change — use the descriptor-v2 envelope (security-model.md). An older
app version derives the correct KEK and even passes the verifier, but then tries to decrypt
the data files with it and fails the GCM tag, surfacing "Could not open the workspace".
Nothing is harmed or written; opening the drive with a current build works. Accepted: drives
ship the app alongside the data, so version skew requires deliberately mixing an old app
with a new workspace.
No reset after a forgotten password (#931). The app never creates a workspace over an
existing one, and it has no reset, so starting over is done by hand: quit, move
config/workspace.json and workspace/ off the drive together, start and create
(troubleshooting.md "I forgot my workspace password"). The new workspace writes its own
diagnostics log over the old one's logs/app.log.enc, so the old log is lost unless logs/ was
moved too, even when the old pair is put back later.
Builds released before #845 (0.1.65 and earlier) cannot detect a newer vault format. From
#845 on, a build refuses a workspace whose descriptor, KDF, .enc frame or password-change
journal a newer build wrote, before anything is written, with "This workspace was written by a
newer HilbertRaum — update the app to open it." (security-model.md "Vault format versions").
An older build reads such a workspace the old way: a descriptor that keeps its wrapped data
key passes for the current format and a password change rewrites it as such, and its startup
sweep and rekey recovery run over the newer files. The same shape as the schema stamp above:
any future vault format has to be designed so those builds fail safely (the frozen constraints
in data-contracts.md "Vault format versions"), and old artifacts still belong off the drive.
A password change cut short waits on what blocks it, and on the right password, for part of
its work (#1015, #1014). When the start cannot put a staged file of a committed password change
in place because another program holds it, the workspace stays locked and the unlock answers "try
again" until the hold ends. A folder at a stored copy's name does not block: that document (or
image) stays unreadable until someone removes the folder, while the rest of the workspace opens
(the next start then puts the new copy in place); the app does not say which file. A folder at
the encrypted workspace file's own name still blocks every unlock until it is removed. A folder at
one of the change's write temps is left on the drive as it is. An out-of-store stored copy outside the
workspace folder (issue #188's absolute paths), or in a folder inside it reached through a link,
stays staged under its new key, beside its old
copy, until the first unlock with the right password, and while the unlock cannot judge it (a
link, a folder or a second hard link at either name, a stored copy that already opens, a newer
build's frame) it stays staged and the journal stays with it; a change rolled back before its
commit leaves such a stage, and its write temp <stage>.tmp, on the drive (ciphertext under a
key nothing holds). Journal entries the app cannot vouch for are left on the drive as they are,
counted in the log without their paths (a folder left in place is counted at each start again,
and so is an entry the app could not check because a stat failed, a hold or a permission: that
file waits until a start or an unlock can check it). With documents/ or images/ kept behind
a link (a junction), the stages there wait for the unlock with the right password, not the start.
A password change that another program gets in the way of can still lose work in three rare
cases (#1027; owner decision 2026-11-22: documented, no notice in the app). Only a workspace made
by one of the unpublished builds 0.1.0 to 0.1.3 has this one-time change. It happens mostly on
Windows, when a program such as an antivirus keeps the new copy of the workspace file locked; on
macOS and Linux a disk or permission error on that file has the same effect. The app then saves the
open workspace itself and removes the leftover copy at the next lock or unlock that can. The
workspace's work since the change is still lost in these cases, as it was before the fix:
The program held the leftover copy through the whole session and its lock, so it is still on
the drive, and an older HilbertRaum opens the Kit before this version unlocks it again: once the
file is free, the older version puts the leftover back over the newer workspace file.
The program also held the password-change record beside it, so that the app could neither
rewrite it nor even read it, both at the change and at every lock of that session: then this
version, too, puts the leftover back at its next start.
The drive was too full to save the workspace right after the change, and the app was then quit
and could not lock the workspace either (the drive still full).
A line in the log says when the change could not move its copy into place. Unlocking once with
this version, after the other program lets go of the file, removes the leftover.
A start that fails shows "The app could not start", and some of it is owed a real-app check (#1024).
A back-end start that throws (a drive that refuses the app's folders, a full drive, a fault in this version) shows
the gate's failure card with the cause and the error code. What is left:
On an encrypted workspace the failure's log lines live in memory only, so they are gone when the app closes:
"Copy details for support" is the way to keep them. The update plan's updates/update.log will record the
failure's class on the drive (when the drive can be written).
A write-protected card or a read-only mount: Node's recursive folder creation reports any refusal other than
EACCES, ENOSPC, ENOTDIR and EPERM as the ENOENT of the check it makes next (review M-1, measured with an invalid
name and a dangling link), so the app makes the missing folders again one plain attempt at a time, from the highest
one, right under the deepest that exists (the drive root and its parent may be missing too, code review CR-3), and
the first that fails reports its real error (EROFS, "can't write to this drive"). That a lock-switched card answers EROFS is read from libuv's source
(Windows' ERROR_WRITE_PROTECT), not measured on a real card. Only when no folder above exists (a drive that is gone)
does the card show ENOENT, and then that is the real answer. With all four folders present such a drive starts,
and the unlock fails instead (main.workspace.openFailed).
EPERM and EACCES read as "can't write to this drive" only for a write (mkdir, rename, write, unlink,
rmdir, copyfile, symlink) or an error that names no system call (code review CR-2); a refused program start
or listing reads as "something else". So does a refused open: a Node error does not say whether the file was
opened for reading or writing, and the start mostly reads (a config/policy.json behind a deny-read rule), so a
refused write through open gets the general text, which also says to check that the drive can be written to.
There is no "Try again" on the card: starting the app again is the retry.
The help line and the fatal screen point at the troubleshooting guide in the drive's docs folder. A drive
prepared for HilbertRaum has one; the app-data folder a standalone install falls back to does not, and the guide
is in English only.
A throw after the back end's start (the app's own renderer files, the menu, the window) has no window to show the
card in: the app shows a native error box with the card's title and its general text in main's language (the
computer's language before an unlock), logs the error's code, and ends (review M-2). A throw before the app is
ready (in the main module itself) still ends with Electron's own error dialog.
A throw late in the back end's start (after some of its services were built or started) leaves that half-started
back end running behind the card (review L-2): on a plaintext developer workspace its database stays open until
the quit, and on a locked Kit nothing it built is reachable (no channel answers but the card's). The quit's
teardown stops and closes what the context (ctx) holds by then; the log says how many channels the start had
registered when it threw.
Measured in the dev app (a drive root that refuses new folders): the state, the code (EPERM), the log line
without a path, "Copy details for support", the other channels refused by Electron, and the card's text arriving
two frames after its alert region (an effect alone had put both in one frame, the #436 trap; the text now waits
two animation frames). Still owed: a by-ear Narrator listen of the card, and Electron's own removal and
re-registration of handlers after a throw that comes after some registrations (the dev app's start failed before
any; the rows use the IPC harness, which models Electron's refusal of a second handler).
Shredding never follows a link, so it cannot reach a file another name shares (#1014). A
symbolic link, a junction or a file with more than one hard link at a name the app shreds is
only unlinked: a plaintext file someone hard-linked keeps its bytes under the other name. Mounts
that report one link for every file (some network and FUSE mounts) cannot tell a hard link.
A workspace whose encrypted file went missing rests in plaintext until the next unlock (#911;
owner decision G-3). When a start finds .enc gone (something outside the app removed it) and
the working file still there, it keeps that file, the only copy of the workspace, as
workspace/hilbertraum.sqlite.recovery, and the next unlock with the right password encrypts it
again (security-model.md "Encrypted file missing"). The residuals:
The copy is unencrypted until that unlock, and the lock screen says so. A user who has
forgotten the password keeps it on the drive indefinitely: the next start no longer shreds it.
Deleting the file by hand is the way out.
Builds up to 0.1.65 don't keep it. One that starts first (a Kit carries several OSes' apps)
shreds the working file as before, and this build's unlock then says the encrypted file is
missing. Once a copy is kept, builds from 0.1.47 on leave it at their start and roll it forward
at their unlock; builds 0.1.6 to 0.1.46 ignore it, so it rests in plaintext beside the vault
until a newer build unlocks (the REL-3 note in security-model.md).
The probe reads only part of a large file, so a partly damaged copy can be kept and adopted,
and the damage shows when the app reads those pages. With no snapshot left, that still beats
losing everything.
A -wal that SQLite cannot replay (it reports the database as corrupt) is dropped, so a copy
kept then lacks the session's last commits.
A copy that is damaged after the -wal replay is shredded, and the unlock then says the file is
missing (owner decision D3). So is a kept copy that is damaged by the time of the unlock: the
right password shreds it (a wrong one touches nothing), and the notice goes.
The start never replaces a snapshot, but the unlock judges an .enc that came back after the
start (a sync tool restoring it, a copy put back by hand) by the CODE-1b roll-forward rule: the
kept copy replaces it unless the returned .enc is newer by mtime. If it is newer, it wins: the
kept copy is shredded as a spent leftover, the workspace opens at that older snapshot, and
nothing reports the session that was lost. The lock screen's section in troubleshooting.md
says to unlock first.
A -wal the replay cannot empty (a full drive, another program reading the workspace) blocks
the start: nothing is moved or shredded, and the unlock shows the "another program is holding a
recovery file" message, whose words name only the holding program (owner decision D4: no copy
change; troubleshooting.md says what else it can mean).
A pre-document-organization build ignores collections on a post-feature DB — but deletes still
work. An older app shows the flat document corpus (it never reads the collections /
document_collections / conversation_documents tables), so organization is invisible, not
corrupting. Document deletion stays safe for those membership/link tables because they declare
ON DELETE CASCADE: a direct DELETE FROM documents (with PRAGMA foreign_keys = ON)
cascade-removes the orphan rows instead of raising a foreign-key violation. The later skills
content tables (bank_statements / bank_transactions / bank_corrections, invoices /
invoice_line_items) are handled two ways: the current build's
deleteDocument does an explicit ordered delete of those rows (purgeDocumentDerivatives →
purgeSkillDataForDocument) inside one transaction before the documents delete, which keeps
deletion safe on existing drives whose FKs predate the fix; and fresh schemas additionally
declare ON DELETE CASCADE down both chains, so even a bare DELETE FROM documents (e.g. a future
caller) cascades cleanly. Note: a pre-skills build deleting a document that has bank/invoice
extractions would hit the un-cleaned FK and fail — the same accepted app-beside-data version-skew
stance as the vault note above (the current build deletes such a document cleanly and atomically).
(See docs/architecture.md "Document organization — design record" §3 and "Skills — design record"
§10.)
Password-change edge: a post-commit swap interruption can briefly wedge one document.
If the one-time v1→v2 migration is interrupted AFTER its descriptor commit but mid file-swap
(e.g. a transiently locked file on Windows), a not-yet-swapped document sidecar stays under
the retired key until the next app start, whose recovery rolls it forward; previewing or
re-indexing exactly that document in the SAME session fails with a friendly error. No data
loss; self-heals on restart.
The persisted checksum cache trusts size+mtime. Model weights are SHA-256-hashed once and the
result is cached (in memory and in AppSettings.checksumCache) keyed by (path, size, mtime) —
re-hashing multi-GB GGUFs on every visit/launch cost minutes of USB I/O. A same-size,
mtime-preserving in-place tamper is therefore not re-detected by the app's routine checks (mtime
is attacker-forgeable anyway). Since #382 (2026-09-08) routine checks are also LAZY — every
screen asks for lazyVerify, so on a cold cache only the ACTIVE model is hashed and a present
but un-started weight is reported installed without being read at all. Damage in such a file
is therefore found when the chat model is started, not before; the other models are not hashed
at their start, except the search and voice models before their first start in a workspace
(#913: their bad output would be stored in the index; a first hash cut short by a lock or quit
caches nothing, so the next start hashes again), so damage in the image, translation or
re-ranking model is found only by a check. Mitigations: the AI Model screen's
per-model Verify checksum forces a real re-hash, its screen-level Check all model files
walks every present weight (since #420, 2026-09-08 the screen-level pass can be stopped with
the Stop checking button beside its progress bar — what finished stays verified, the rest is simply
unchecked; the per-model Verify checksum button is still uncancellable, one file), the §7.4 start
gate re-verifies the chat model it launches, every other role refuses to start a file a check
found damaged (#913: the cache is read at each start, about 1 ms), and the
ship-time gates (verify-models --strict, assertCommercialDrive) always hash fully. Downloads now fsync the .part to the device before renaming it into place (F-34,
full-audit 2026-07-16), closing the post-completion power-cut/unplug window that could otherwise
persist the rename + (size,mtime) cache entry over a torn weight the cache then reports verified.
A cancelled checksum read can leave a file PARTLY page-cache-warm with no warm mark (accept).
#392 registers a hashed file in checksumWarmedPaths so a later model-load window over it never
times a RAM read — but only when the hash completed. A pass cancelled mid-file (#420) has
pulled part of that weight through the page cache and leaves no mark, so a model start right
afterwards can record a partly-warm model_load sample. Bounded: the figure lands between the two
honest ones (fully cold and fully warm), never above the warm one, and it is rare — it needs a
cancel landing inside one specific weight followed immediately by a start of that same model. The
alternatives are both worse: marking a partial read warm would suppress an honest sample on the
strength of a read that mostly did not happen, and recording a checksum sample for it would
publish a throughput figure for a duration the read never finished. Self-healing — the next cold
start of that model samples honestly.
Sidecar binaries built by an OLD fetch-runtime carry no pre-spawn hash (accept + document).
The re-hash-before-spawn control (security-model.md "Re-hash
sidecar binaries before spawn") re-verifies llama-server / whisper-cli against a SHA-256 the
install marker now records. A drive provisioned by a fetch-runtime.{ps1,sh} predating that change
has no recorded hash, so the verifier tolerates the binary (skip-legacy) rather than refusing to
start — it stays unprotected until the runtime is re-fetched. Since PR #271 (#234) the sell gate
(assertCommercialDrive, which both builder scripts now call) refuses a hashless marker and
fetch-runtime --commercial re-fetches it, so a newly built sold drive cannot carry one; a
self-built DIY drive keeps the tolerance. A spawn-time refusal on commercial drives is wired but
switched off (REFUSE_HASHLESS_MARKERS_ON_COMMERCIAL_DRIVES in binary-verifier.ts) until the
owner rules on kits sold before this change (#234). Trust there still rests on drive provisioning +
filesystem integrity, the same residual already accepted for on-drive sidecars and app skills.
The pre-spawn check covers the files an engine's marker records, nothing more (#1012 — accept +
document). Since #1012 the verifier re-hashes every file the engine copy's own install marker records
(the libraries beside the program included) before the first spawn of a session. Three things stay
outside it or work less well than one would hope (security-model.md "What the
check does not cover"):
Markers written before #998 record the program alone. A Kit or drive built before then keeps a
program-only check until the engine is installed again (in-app or with fetch-runtime).
A file added to the engine folder is not noticed. llama.cpp's backend loader loads every
ggml-<backend>-* library it finds to ask for its score, so an added library beside the program can
run. Each llama-server spawn also inherits the app's working directory, which is among the folders
the loader searches (from llama.cpp's source as remembered; not re-read at b12110). The kiwix
children start in the knowledge-pack library's folder. A recorded library missing from their copy
is refused (the loader would look for it there), but an unrecorded one is not checked.
A library that stays unreadable gets no repair offer (review R-4). Examples: a security product
that denies access and leaves the file, or a wrong file permission. Every start is refused as
unreadable, and "try again in a minute" keeps coming back, because on Windows a lasting deny-read
cannot be told from a passing hold (both read as EPERM or EBUSY). That records no "engine files
damaged" verdict (it is not damage), so the in-app reinstall is refused ("nothing to repair") and the
chat runs on the demo runtime. The fix is outside the app: allow the file in the security product, or
restore its permission. (A folder or another non-regular file at a recorded path is different: it
counts as missing, so it gets the "Install again" offer — code review round 5.)
A follow-up proposes refusing an unrecorded library and starting the engines in their own folder.
What a missing or changed recorded file does:
The engines: any missing file is refused as damaged engine files, with the "Install again" offer.
That holds even for a file the engine never loads on this computer (owner decision). Helpers without a
cpu/ rung (search, reranking, images, translation) stop with the chat engine. A changed file gets
the same verdict and offer since code review round 6, and its log line still records a possible
tamper.
The knowledge-pack tools: they have no in-app repair. A missing program or library stops them
(with their own "file missing or could not be read" error, not the tamper one); any other missing file
(a tool the app never runs) is only logged.
Cost: while a file is missing or unreadable, each start attempt checks the copy again, since those
verdicts are not cached. A missing program or library, and for the engines any missing file (round
7), is found by a stat of each file before any is read, so nothing is hashed. A locked file
costs the read up to the lock. When only an unused knowledge-pack tool file is missing, the tools
still read their whole copy once to check the rest, then keep that verdict for the session (round 7).
What a file that cannot be read just now does (an antivirus scan holding it):
It refuses that attempt without blaming the GPU, the model or the engine.
The search, reranking, translation and image helpers try again on their next call, with nothing
latched.
A translation (on screen or as a document task), an audio import and dictation stop at once and say
"try again in a minute".
A chat start in which an attempt ended so latches nothing, not even what its other attempts showed.
It runs on the demo runtime, with the usual "this model could not be loaded" notice when an attempt
on the processor failed to load the model, else with "try again in a minute" (round 6: also when
the card attempt failed, or another copy of the engine was refused).
Starting the model again: resending a question is not enough. It gets another simulated answer,
because nothing restarts the model, and choosing the same model again keeps the demo runtime running.
The notice's button opens the AI Model screen: choose "Stop runtime", then "Use this model". That
start walks the ladder again, and so does the next unlock.
When a higher attempt could not read its files but a lower one started, the chat runs lower (on the
processor, say) for the session without a notice. Only the log says so; the next start of the model
tries the card again.
An image question fails with "try again in a minute" and can be asked again at once (no cooldown).
A knowledge-pack tool file that cannot be read just now does not keep the packs down for the
session: the next question that uses a pack tries again. A missing one does, until the pack set
changes.
What an install marker that is there but damaged does (#1028, 2026-11-23: cut short by an interrupted
copy, garbled, or recording a file under something other than its SHA-256):
The engines: refused as damaged engine files, with the "Install again" offer, exactly as for a
missing file. Before #1028 such a marker counted as none, and the engine started with nothing checked.
The knowledge-pack tools stop, like a missing program or library (owner call 2026-11-23), and their
repair is outside the app: delete runtime/kiwix-tools/<os>/ (the Knowledge-packs panel then offers
to install the tools), or re-run fetch-runtime --family kiwix_tools. Unlike the engines, the refusal is
kept until the pack set changes or the app restarts (code review CR-7): it has their files kind,
which the pack service latches, so a marker repaired while the app runs (by hand, or by a script run) is
not picked up by the next question. Restart the app after the repair.
An old drive set up with the bash script under Git Bash on Windows may be asked to install its engine
again (code review CR-1). Between 2026-06-21 and a later fix, fetch-runtime.sh on Git Bash, for a
target path with a backslash and an archive whose pin had no real hash yet, wrote a marker whose hash
entry could not be parsed. Before #1028 the app took that marker for none and started the engine without
checking it; now it refuses the copy as damaged engine files. This is the intended outcome, and very few
drives carry such a marker. "Install again" on the AI Model screen, or a re-run of fetch-runtime, writes a
good one.
A marker edited by hand is held to the same rule. Only the byte-order mark an editor may add is read
past; a UTF-16 save, a missing field or an entry that is not a hash makes it damaged.
fetch-runtime reads the marker as the app does (review round 2: both twins carry a small JSON reader of
their own, marker_readable and $ReadInstallMarker), so it fetches again every marker the app refuses.
On a doubt it fetches again too, a needless download, for markers no writer writes: one over 64 KiB (the
app reads up to 1 MiB; final review: the .sh reader is plain bash, slow on a large text — measured on Git
Bash, a marker shaped like a real one takes 0.25 s at 5 KB and 2.2 s near 64 KiB, and a crafted one of tiny
strings 20 s near 64 KiB), a control character (DEL included) or an escape in a field name, a map naming one file twice, two names that differ only in
case (.ps1), and a recorded file name holding ,, ", {, } or \ — the .sh twin's older readers of
the recorded names and hashes cannot read such a name, so that engine is fetched again on every run.
llama.cpp, whisper.cpp and kiwix-tools ship no such names. Should a script still report the engine already
installed while the app refuses it, delete the engine folder and run the script again.
Residual — a garble of the word binaries itself. The marker then reads as one with an unknown field
and no map, a hash-less marker, so the copy is not checked (skip-legacy). Unknown fields must stay
accepted (a later release may add one, data-contracts.md), so this cannot be told from a real hash-less
marker. For the engines, a garble anywhere else is caught: a structural character or a field name
makes the marker damaged, a hash makes its file changed, and a recorded name makes the program unrecorded
(damaged) or the named file missing (damaged files). One exception: a garble that turns the single key of
a marker written before #998 (it records the program alone) into a name under cpu/ leaves a map that
records nothing of the copy, so the copy is not checked.
Residual — the knowledge-pack tools and a garbled name. A garble in the name of a file that is neither
their program nor a library (kiwix-search, a licence text) — or one that turns a library's name into a
name that is neither (icuuc74.dlm) — reads as that file missing. The tools start on missing-other (owner
call on #1012), and the real file under the true name is not checked: a changed library then runs.
Residual — a second top-level binaries.JSON.parse keeps the last of two same-named fields, so a
marker that carries a map and then "binaries":{} reads as hash-less and its copy is not checked. Only
someone who can write the marker writes that (no damage makes a second field), and that person can also
rewrite the hashes.
Residual — a link at the marker's path. The marker is found with stat, which follows a link: a
link to a file is read as that file, and a dangling link reads as no marker (a hand-placed bundle,
skip-legacy). exFAT, the Kit's file system, has no links; on another file system only someone who can
write the engine folder can place one.
App-skill integrity is by location, not signature (Skills §22-M2 — accept + document). A
shipped skill's trusted_level: app is assigned because it sits in app-skills/, copied there at
drive-build. On a removable drive app-skills/ is writable, so "verified" means build-time
provisioning, not a runtime hash; an attacker with physical write access could alter a shipped
skill. A hash manifest on the same writable drive would be unanchored (rewritten too), so real
integrity needs off-drive signing (a Tier-3 prerequisite, not in scope) — the same residual
already accepted for the engine binary and on-drive sidecars. Blast radius is bounded: a tampered
instruction skill is still only injected reference text behind the prompt-injection guard (it cannot
run code, reach the network, read other files, or widen document scope). See
security-model.md ("App-skill provisioning…").
Skills are non-confidential by design (DS20). A skill package is task knowledge, not secret
user content: app-skills/ and user-skills/ are plain (unencrypted) folders outside the
encrypted workspace/. Truly sensitive material belongs in a document (which stays encrypted),
never in a skill. Two consequences: a skill is readable on a lost/shared drive, and because
user-skills/ is a top-level directory (not inside workspace/), a workspace backup must also
include user-skills/ or imported user skills are lost.
A workspace DB rebuild re-derives user skills as DISABLED and clears the acknowledgement. The
skills table is a pure derived cache; disk (the skill folders) is the source of truth. A DB
rebuild/corruption re-discovers every user-skills/ folder, but a re-discovered drop-in installs
disabled with warning_ack cleared (the DS19 safe default — a rebuild is a fresh discovery, not
a confirmed import). No skill content is lost; the user simply re-enables each user skill (and
re-acknowledges its warning) in Settings → Skills. App skills are unaffected (they re-derive enabled).
Prompt-injection in a skill body is contained structurally, not by delimiter purity (Skills S12
audit). The selected skill's instructions are injected as a fenced data block and the
app-authored guard line is the last line, but the body is inserted verbatim — a hostile body can
forge the fence's own --- END LOCAL SKILL --- delimiter or shout "ignore previous instructions".
The guard line still wins structurally (it is appended after the whole block; a consolidated test
pins this), and the real defence is the structural ceiling: an instruction skill can only emit
text, and a Tier-2 tool sees a frozen documentIds scope with no Db/SQL/FS/net handle — so even a
"successful" text-level injection cannot run code, reach the network, read other files, or widen
scope (§14). We deliberately do not sanitize/escape the body delimiter (it would mangle
legitimate instructions for no real gain). See security-model.md ("Skill tool
ceiling").
A user skill's triggers.filenamePatterns are compiled to a RegExp (Skills S12 audit — now
actively bounded, post-S12). The deterministic suggestion heuristic turns a *statement*-style
pattern from a user-installed skill into an anchored, case-insensitive regex matched against the
in-scope documents' filenames. The skill must already be enabled by the user, and the match runs
only on a user action (the picker) — there is no auto-fire (deferred to S13). The earlier-noted
"length-bounded matcher is future hardening" has now shipped (architecture.md "Skills — design
record" §13, S2): the parser caps each trigger entry's length (≤200) and count (≤64). The earlier
guard — a regex compiled from the glob with a cap of 10 * wildcards — was replaced by a
linear, non-backtracking two-pointer matcher (selector.globMatches): the old cap
counted only *, so a *?*?… pattern (≤10 stars, ? interleaved) still compiled to a degree-10
backtracking regex that could freeze the synchronous main-side scoring on a moderately-long document
title. The two-pointer matcher cannot backtrack at all (and no longer refuses legitimate
wildcard-heavy globs), so catastrophic backtracking is now structurally impossible, not merely
bounded.
Skill triggering runs on ONE canonical bilingual vocabulary (Skills W5), word-boundary matched — the
OFFER is precision-first, ROUTING is recall-first.services/skills/vocabulary.ts single-sources each
app skill's trigger terms; the SKILL.md triggers.keywords (the suggestion manifest) are regenerated
from it and pinned by a parity test, and the routing gates (isAnalysisShaped, the whole-doc shape
gates, isRedactionShaped) read the same source via routeMatch — so the two lists can no longer drift.
A single-token keyword is matched at word boundaries (net no longer intercepts "Netflix", bill
no longer "billboard"), and a suggestion additionally requires ≥1 keyword hit (a lone statement.pdf
in scope no longer stands a permanent question-independent offer). Two deliberate asymmetries remain:
(1) an OFFER on a single-token German noun is word-anchored, so a closed compound ("Rechnungsposten",
"Kündigungsfrist") does not earn the offer even though the same term routes once the skill is
active (routing uses substring stems — recall beats precision under an already-chosen skill, spec §8.2);
(2) meeting is offer-able as a bare word (the "Summarize this meeting" incident requires the offer to
fire), so a scheduling ask ("schedule a meeting") can still draw a meeting-protocol offer — the measured
suggestion precision is ~98 % on the eval corpus, and every suggestion surface stays consent-first
(updated for #80/#130, per #136): the in-picker suggestion is inert, the per-answer offer row
("Run "…" for this question", #80) runs only on an explicit click, and auto-fire (the separate
opt-in, default off) additionally requires a matching document deliberately in scope (#130) — never
auto-applied from a suggestion alone. The redaction manifest↔handler pair is now aligned (Skills U4, audit §4.4): the pure
legal words (datenschutz/dsgvo/gdpr) were dropped from the vocabulary — the handler acts on
neither routeMatch nor the informational PII scan for them ("Was regelt die DSGVO?" is about the LAW,
not the document), so redaction no longer offers or auto-fires on them. The bare PII-content
topics went the same way: personenbezogene daten in #608 and sensitive data/sensible daten in #604
(GDPR, privacy-notice and contract questions got Redaction, and with auto-fire on and a PDF selected a
count scan instead of an answer). They still route once a skill is picked (the German phrases under
Redaction and Share-Safe, sensitive data under Redaction), so with Redaction picked "what sensitive
data is in here?" still gets the per-category counts, and a question that also carries a removal word
("Löschfristen … für sensible Daten") gets the Redact button. A removal request or a check before
sharing that names only the topic ("Please black out all sensitive data", "bitte auf sensible Daten
checken") gets no suggestion: pick the skill.
German removal requests get the Redaction offer only in a few word orders ("…
personenbezogenen Daten entfernen", "Lösche die personenbezogenen Daten …"): one that names only the
data ("eine Version ohne personenbezogene Daten"), uses another verb, or another form of these verbs
("Entfernen Sie …", "Bitte personenbezogene Daten löschen.") gets none, so pick the skill yourself.
This is a lasting limit of keyword suggestion, not a gap in a list: a blind evaluation (#602) found
no German removal words that catch more requests without also firing on legal questions. Share-Safe
Review is likewise rarely suggested for German "can I send this?" questions ("Geht das so raus?",
"Ist der Entwurf reif für die Gegenanwältin?"); a second blind evaluation (#603) found no phrase
list that catches them, so pick the skill yourself there too.
A skill picked in the composer applies PER-TURN, is visible, and is reversible (Skills U3, audit
§4.3 / ux-6). Before U3 every picker pick — including accepting a one-off suggestion — was silently
written to the conversation's persisted default (active_skill_id), so a pick made many turns ago
kept shaping later answers invisibly (a large contributor to "inconsistent results"), and the "answer
without it" undo existed only for auto-fired rows. Now a pick sets a session override that
shapes the turn but is not persisted; the composer shows a persistent chip with an ×, and
the picker gained an explicit "keep for this conversation" checkbox that is the single writer
of the sticky default (active_skill_id). Every other path — the ×, picking None, and un-checking
keep — clears any saved default, so a superseded default can neither resurface on reload against
the user's visible choice nor contradict the (unchecked) keep-checkbox. Pre-existing sticky defaults
keep working: an untouched composer still resolves and applies the saved default (and reads as kept). The send path passes the
session pick verbatim (turnSkillArgFor: an id, an explicit null = no-skill-no-auto-fire, or
undefined = "resolve the saved default and maybe auto-fire"), so the chip and the answer can never
disagree, and the "answer without this skill" undo now rides every skill-stamped last turn,
not just auto-fired ones. ux-6: the Summarize/Categorize run-bar buttons surface their real
output by routing a question into the transcript answered by the 0-model bank handler; that relay now
pins askDocuments to the run's document (the resolved target id, re-validated main-side and
ignored if out-of-scope), so a multi-document or whole-library scope can no longer scatter the answer
across the wrong documents — and the two routed buttons (plus the post-extract "Categorize" follow-up)
are hidden in plain-chat mode, where the routed answer would be unreachable. All renderer +
turn-resolution + scope-pin plumbing — no routing-engine change. Residual: the session override is
in-memory, so a per-turn pick that was never "kept" does not survive an app reload (by design — that
is the point of per-turn); and the relay pin degrades to the ordinary conversation scope if the run's
target id was lost (a screen remount with no resolved id), rather than failing.
Auto-fire can now reach the three complaint skills, but only on an EXPLICITLY-scoped document — and it
stays default-off (Skills U4, audit §2.4/§4.4). Before U4, only document-redaction declared
triggers.autoFire, so bank-statement, invoice and meeting-protocol could never auto-fire even with
the user setting on; U4 opts all three in (their applies() gates are already single-doc + intent-shaped,
and the S13c one-click "answer without it" undo exists). Two guards keep the expansion honest: (1) the
master setting skillsAutoFireEnabled remains default-off (the safe-merge posture — inert in
production until the owner flips it); (2) auto-fire's doc-signal corroboration is narrowed to explicitly
scoped documents — a chat attachment or a hand-pick. A whole-corpus Library/collection scope
contributes no doc signal, so "keyword + ≥1 doc signal" no longer degrades to "keyword + any matching
PDF anywhere in the library": a lone keyword with an incidental library match scores only 2 (< the ≥3
bar) and does not silently fire. Strong intent (two distinct keywords) still auto-fires without an
explicit doc, and the inert suggestion offer deliberately keeps reading the full scope. The measured
auto-fire gate on the expanded eval corpus (incl. whole-corpus shapes) holds fired-wrong == 0 and
precision ≥ 0.95. Residual: the narrowing keys on scope.documentIds (explicit selection ∪
attachments), so a collection-scoped conversation — even a small hand-curated folder — is treated as
whole-corpus for auto-fire and yields no doc signal; that is deliberate (only a document the user put in
front of the skill corroborates a silent fire), but it means a narrow-collection user must lean on keyword
strength or an explicit pick.
Copy, i18n, and export-dialog polish — six user-facing fixes, no engine change (Skills U5, audit
ux-12/15/16/17, §3.6, §6.2). (1) German assistant-voice → du: the deterministic bank/invoice analysis
answers and the routing/redaction answers now address the user informally (du) everywhere; a lint-ish guard
test (skill-i18n.test.ts) flags any formal Sie/Ihr regression in the skills.*Analysis.* /
routing-answer keys, while tolerating a sentence-start pronoun Sie (it/they — the redaction copy relies on
Sie läuft/Sie verarbeitet). (2) The needsExtraction run-bar error now names the ACTUAL extract
button to click first, interpolated per the failing tool's domain (bank downstream → "Extract transactions";
invoice → "Extract invoice"), rendered as plain text with the label in quotes (the bar is not markdown). (3)
The "tools run only when you start them" claim — false since read-only analysis tools auto-run to answer a
question (D46/the exhaustive path) — is corrected in the settings note (skills.tool.note.active), both
SKILL.md bodies, and the user guide to "read-only tools may run automatically to answer your question;
anything that writes or exports a file always asks first" (the model still never invokes a tool itself). (4)
Per-export save-dialog metadata (§6.2): the ONE hardcoded CSV dialog no longer serves every export —
JSON→.json, XML→.xml, and the redacted copy gets a "Save redacted copy" title + a .txt filter (it used
to fight redacted.txt with an "Export transactions"/.csv dialog on Windows). The dispatch (tool-runs.ts)
binds the per-tool metadata as content-free i18n keys and the IPC saveTextFile closure resolves them;
CSV stays the default. (A2 later folded this into the self-describing tool registry — each export tool
names its own dialog in shared/skill-tools.tsdescriptor.dialog, which the dispatch reads.) (5) A last-chunks citation stopgap for long invoices: the
totals print at the END, past the first MAX_CITATIONS cited chunks, so buildInvoiceCitations now reserves
the final TAIL_CITATIONS slots for the closing chunks (leading + trailing windows, in document order). (6)
An ephemeral "reading the document…" notice when an exhaustive skill handler starts a long, silent
extraction (the "one-blob answer reads as a hang" gap, §3.6) — it rides the compaction ephemeral channel with
a new kind:'analysis' and clears on the first answer token (never buffered/persisted, R14). Residuals:
the invoice CSV export still uses the shared "Export transactions" CSV title (the plan scoped per-tool titles
to JSON/XML/redaction; the filter/extension were the §6.2 defect and are correct for CSV); the citation
head+tail split is a stopgap until per-figure invoice provenance lands (mirroring
bank_transactions.source_page); and one non-skill Images string (images.drop.busy) still uses formal
Sie (outside U5's skill-string scope).
The renderer run store is per-run and conversation-gated (skills-audit-2026-07-03 U6, SKA-6/17/18/25/29/37/38/39/40/41).
After A2 made tool runs per-document concurrent MAIN-side, the renderer kept a SINGLE module-level active
run, and ChatScreen rendered that one app-wide run's bar in EVERY conversation. U6 re-architects
renderer/lib/skillruns.ts into a multi-run store keyed by runHandle (each entry carries
{run, conversationId, documentId}), mirroring the A2 controller; ChatScreen gates the busy/result bar to
the run whose conversationId === activeId and shows a quiet "a skill is working in another chat" chip
for runs elsewhere (SKA-6). A second run no longer silently abandons the first (both outcomes are shown +
acknowledged); the post-extract Categorize offer refuses (hidden) when its remembered document is not in
the current conversation's scope, and MAIN hard-refuses a confirm-gated tool run whose requested document
is out of scope even when exactly one doc is in scope (SKA-29 — a confirmation for doc X never executes
against doc Y; read-only tools keep the tested single-doc convenience fallback). A listSkillRuns IPC
(ids/counts only) lets a reloaded renderer re-adopt in-flight AND terminal-unacknowledged runs — the
launching conversation + target document are threaded onto the content-free SkillRunState
(conversationId?/documentId?, additive) so a reload can re-gate + re-pin the routed relay; a busy refusal
carries the running handle as a fallback re-attach path; never-acknowledged terminal runs are TTL-swept in
the controller (bounded Map) (SKA-17). The store shallow-compares (state/count/resultKind/progress)
before notifying so a 400 ms no-op poll no longer re-renders ChatScreen ~2.5×/s (SKA-39), and tolerates N
consecutive poll failures then keeps a labelled "couldn't check on this skill" row instead of silently
dropping a live run (SKA-40). The run bar's live region is now one always-mounted aria-live status
container whose text swaps (SKA-41, the app's M-U1 lesson). The transcript's "answer without it" undo +
Try again render only when the LAST message is that assistant turn (SKA-37 — a trailing unanswered user
turn no longer misdirects the undo to a later question), and the skill glyph + undo are keyed off the
persisted messages.skill_id with a localized "(removed skill)" label, so DELETING a skill keeps the
provenance (consistent with a disabled skill) (SKA-38; the in-app deleteSkill() path honours this since
full-audit 2026-07-11 GAP-1 — it clears only the sticky conversation default, never the per-message
stamps its pre-SKA-38 ref-clear sweep used to erase). The 'new'-composer skill pick is deleted after being
carried onto the created conversation, so it no longer resurrects on a later empty composer (SKA-18).
Residuals (accepted): when a single conversation holds two concurrent runs (a multi-document scope,
different docs), the bar shows only the MOST RECENT one (v1 tools are single-document, so this is rare); a
reloaded run's busy/result row falls back to the count label until its target name re-resolves (the U-1
renderer-remembered name is React state, lost on reload — the document id is re-pinned from the store); and a
run whose polling gave up shows a "state unknown" row rather than a definitive outcome (main may still hold
the true terminal state, re-adopted on the next reload). One narrow re-attach edge: the routed relay
acknowledges (clears main-side) a routed run BEFORE its answer streams, so a reload normally never re-adopts
an already-relayed run; but if that clearSkillRun IPC silently fails AND the renderer reloads before the
30-minute TTL sweep, the re-adopted terminal routed run would relay its answer a second time (a duplicate
transcript turn). Accepted: clearSkillRun is a trivial in-process IPC that effectively never fails, and the
window is a reload before the answer even finished persisting.
Skill package lifecycle hardening (skills-audit-2026-07-03 U7, SKA-15/16/30–36/42 + SKA-45 riders).
Ten package/manifest/installer/Settings fixes. (SKA-15) all 8 bundled SKILL.md bodies merge heading +
honesty-rules intro + bullets into ONE paragraph — the only paragraph buildSkillFence GUARANTEES at a
tight budget — closing the residual decapitation the U1 reorder left (P0 was the bare # heading, so a
budget-squeezed turn shipped an intro promising rules with none delivered; the parity test had pinned
the wrong paragraph and now trims the REAL bodies through the builder at a rules-only budget).
(SKA-16) a non-file SKILL.md (a directory, from hand-unpacking) or one unreadable folder no longer
kills ALL reconciliation for the session — the manifest reader requires a real file and discovery guards
every per-folder read (structural error + continue). (SKA-30) the zip/folder duplicate-path guard is
CASE-FOLDED (+ file-vs-directory merge), so SKILL.md+skill.md polyglot packages refuse instead of
installing different instructions per OS; ASCII fold only (String.toLowerCase, not the exact NTFS/exFAT
fold tables) — an exotic non-ASCII casing pair could still merge on write (residual). (SKA-31) YAML
parse errors are a fixed structural string + numeric line/column — never String(err) with the yaml code
frame quoting attacker frontmatter (canary-pinned). (SKA-32) discovery/reconcile errors surface:
startup logs count + structural codes, and Settings → Skills shows "N skill folders could not be read"
(count only — an invalid folder name is arbitrary user text and never crosses the IPC/log). (SKA-33)
a failed import toast shows the precise localized structural reason (mapped back out of the wrapped IPC
message), with the generic toast kept for unexpected failures (an ENOSPC/lock throw is deliberately NOT
mapped — wrong-specific copy is worse than generic). (SKA-34, decision) export mirrors import's
acceptance (everything allowed under the skill dir minus the root manifest.json cache, dot-entries,
symlinks; the canonical-subdir allowlist deleted) and import now skips dot-named entries too, so
export(import(pkg)) == pkg holds exactly (round-trip test); residual: a hand-made DROP-IN folder
can still hold files an export packs but a re-import refuses (over-cap sizes; a case-colliding pair
created on a case-sensitive FS) — export applies no size caps to the user's own files by design.
(SKA-35) import-preview notes are localized via stable note CODES + app-fixed params (the error-code
precedent); the localized.<key> family no longer interpolates the attacker-chosen locale key, and
locales dropped at the 16-cap now emit a note. (SKA-36) crash-leftover .skill-import-* staging and
.skill-backup-* dirs are swept at reconcile, age-gated > 1 h by mtime (a live import's dirs are never
swept; the backup's mtime is TOUCHED after the rename so it doesn't inherit the old install's stale
mtime); a younger leftover is skipped by discovery (dot-names are never packages), so it can't surface as
a phantom folder error meanwhile. (SKA-42) document-redaction's SKILL.md names BOTH button labels
(EN + DE) so a German fence-answered turn no longer points at a nonexistent affordance. (SKA-45
riders) Unicode bidi direction controls are rejected in every displayed frontmatter string (title/
description/author/language; ignored-with-note in localized overrides) — cosmetic picker spoofing — and
the stale S13a-era autoFire comment was refreshed.
Run-seam edge hardening (skills-audit-2026-07-03 R9, SKA-24/26/27/28/44). Five run-seam edges.
(SKA-24)withDocumentLock acquisition is abort-aware: a run PARKED behind another lane (queued
behind a long categorize holding the lock for minutes of LLM batches) now rejects on Cancel — the
controller flips it to cancelled immediately instead of a dead "running" spinner + busy refusals until
the other lane finishes; the aborted waiter settles its already-published chain link, so later callers
never wedge (pinned by a third-caller test). The chat-analysis turn signal and the categorize doctask
signal ride the same rail. Residual (accepted): cancellation INSIDE the critical section stays
cooperative (the tools' own signal checks) — abort only interrupts the park; and an already-cancelled
run facing a FREE lock still runs the seam far enough to record its honest 'cancelled' run row (the
pre-R9 tested contract). (SKA-27) the file-export tail is B4-guarded: a finishRun throw after the
minutes-open save dialog (workspace locked underneath it) no longer strands the run at 'started' NOR
reports "failed. Nothing was changed." after the file WAS written — the outcome reports what happened
to the FILE; bookkeeping gets one guarded retry and then only a local log. 'done' is stamped at the
actual write, not the pre-dialog prepare (run history no longer timestamps an export minutes early).
The adversarial review found runDocumentRedaction — the other dialog-shaped seam — carried the same
class (its unguarded post-write 'done' fell into the outer catch → 'failed' + "Nothing was changed."
after the copy WAS written); same treatment applied there.
Residual: if the workspace is PERMANENTLY unwritable, the row genuinely cannot reach a terminal
status — the user still gets the truthful success. (SKA-28)runCashflowSummary and the file
exports now hold ONE per-document lock across prepare + load + serialization (the last two downstream
seams that held none), closing the microtask-narrow TOCTOU where a competing replaceExisting extract
interleaved between the staleness re-extract's release and the row load (empty CSV, "saved 0 rows");
the export's hold RELEASES before the save dialog, so a parked dialog never blocks the document's other
lanes. (SKA-26, decision: flip) extractor-version staleness is now v !== CURRENT, not v <: rows
written by a NEWER extractor re-extract too — on a portable drive the app roams with the workspace, so
a mismatch means a deliberate rollback (where the newer extractor IS the suspected bug) or a second
install; serving its rows as fresh was exactly backwards. Deterministic extractors make the flip safe
(same version ⇒ same rows ⇒ no loop). Accepted cost: a workspace alternated between two app
versions re-extracts on EVERY switch, and each replaceExisting re-extract drops the persisted per-row
categories (the rows changed with the parser; the honest move is recomputing — the next categorize run
restores them). (SKA-44, decision: demote) the EN transfer categorizer rule is confident: false
like R3's sepa/überweisung — "TRANSFER TO NETFLIX…" now reaches the 15-category LLM instead of
being pre-filtered into 'Transfer' (same rails-not-merchant semantics; the offline deterministic
fallback still labels it Transfer). No extractor bump; the T1 snapshot is untouched (categories are not
extraction output).
Eval & test-infra sweep close (skills-audit-2026-07-03 T2) — two accepted residuals + one recorded
test-guard acceptance.(SKA-43, decision: accept — no cache) the needle-downgrade calculus still
re-scans the document per needle-shaped turn (documentApproxTokenTotal's all-chunks read + KMP
de-overlap, then retrieveWholeDocument repeating the same pass; twice more per compare). NOT cached:
the passes are milliseconds of in-memory string work against the model call the turn then makes
(seconds to minutes on CPU), while a memoized per-document token total would need invalidation at every
chunk-mutation site (re-index, purge — plus any direct chunks UPDATE) and a STALE total would silently
mis-size the needle downgrade and the compare budget split: a correctness-adjacent risk bought for an
imperceptible win. Revisit only if profiling ever shows the scan itself hot. (SKA-45, last open
sub-item) the buildSkillFence O(n²) growth loop stays as written — bounded by the 64 KiB body cap
(hostile-input worst case ~100–300 ms, once per turn), a perf micro, not a correctness item. With these
two recorded, every SKA-1…SKA-45 item of the 2026-07-03 audit is dispositioned (fixed or documented
residual). (T1 snapshot guard — accepted input-edit exemption) editing a fixture in the same commit
exempts its OWN output change from the extractor-version bump (the inputHash discriminator): that is
inherent to legitimate corpus upkeep, and smuggling an extractor change through it would require a
visible fixture edit in the same diff. The two REAL guard gaps are closed by T2's self-checks: each
committed hash is recomputed against its own committed output, and the snapshot's recorded extractor
versions are pinned to the live constants — a hand-edited hash or a bump-without-regenerate now fails
the default suite.
Extractor evaluation infrastructure — a real-layout corpus, an output-snapshot version-bump guard, and an
opt-in real-model smoke (Skills T1, audit §7 recs 1/2/5). The recurring wrong-figure incidents
(INVOICE-TOTALS-1, HVB zero-transactions, the §5.3 NBSP/Unicode family) were real-LAYOUT features that
post-hoc synthetic fixtures never carried, and no skill path was ever exercised against a real model (the
RUNTIME-5/6 vision-salad test-blindness class). T1 lands three guards: (1) a single committed real-layout
fixture corpus (tests/fixtures/real-layouts/corpus.ts — constructed AT/DE/CH statements + invoices, never
real user data, special chars as \u escapes) consolidating the incident classes (NBSP/narrow-NBSP,
U+2212/en-dash signs, Summe/Endbetrag/Rechnungssumme labels, SEPA rows, dd.mm.yy + cross-year dates, wrapped
descriptions), run through the REAL production extractors with the parsed figures asserted; (2) an
output-snapshot guard (skills-extractor-corpus.test.ts + extractor-output.snapshot.json) that hashes each
fixture's full extractor output keyed by extractor version — any output change FAILS the default suite
unless the affected *_EXTRACTOR_VERSION was bumped and the snapshot regenerated
(UPDATE_EXTRACTOR_SNAPSHOT=1 …), the mechanical backstop for the "every behaviour change bumps the
version" rule that green synthetic fixtures did not enforce; and (3) an env-gated opt-in real-model smoke
(tests/e2e-model/skills-smoke.test.ts, SKILLS_SMOKE_MODEL=<gguf> + SKILLS_SMOKE_ROOT=<drive root>)
driving one bank + one invoice (the third-mode grounded-data path) + one German minutes turn against a
real local model, asserting STRUCTURE +
FIGURES (the deterministic echo, the extract count) not prose. Details: model-benchmarks.md
§10. Residuals: nothing in the default npm test needs a model or the network (the smoke skips cleanly
without both variables and is NOT wired into CI — it is a manual pre-release / post-pin-bump gate); the corpus fed
the PLAIN-TEXT extractor path only until invoice-hardening-2026-07-04 P4 added the first geometry INVOICE
fixture (invoice-de-geometry-columns, through the real reconstructPage) — geometry BANK coverage was
already there, and the reconstruction's own unit tests remain the deep coverage. (The corpus once surfaced
a gap — the abbreviation USt/Steuerbetrag was not in the invoice TAX_LABELS, so a standalone USt … EUR tax-total line read as a phantom line item — closed by invoice-audit-2026-07-06 IA-3 (T-4): ust
and steuerbetrag (and nettosumme) are now totals labels, while USt-IdNr: ATU… still falls through
because its remainder is not filler-only.)
Glyph-mangled (per-glyph) PDF text layers are DETECTED and refused, not repaired
(invoice-hardening-2026-07-04, architecture.md "Skills — design record" §42). A PDF whose text layer
fragments into single-glyph runs ("1 0 % 3 Article") now stamps textQuality: 'suspect', gets ONE
re-read through the geometry (reconstructPage) path, and — unless the figures then POSITIVELY
reconcile — an honest "this document's text doesn't extract cleanly" refusal pointing at OCR/the
original, instead of confident garbage totals (the 2026-07-04 incident class). Residuals, accepted:
(a) the looksLikeGlyphSoup heuristic is deliberately conservative (≥ 3 soup-shaped lines AND ≥ 20% of
non-empty lines) — a lightly-mangled document below both floors still parses without the caveat;
(b) the geometry retry runs ONCE per document (suspect-confirmed is final) — re-import/re-index to
retry after an upstream fix; (c) geometry reconstruction recovers COLUMN-scrambled layouts, not
per-glyph spacing (those correctly end at the refusal + OCR guidance); (d) the format-negation window
is 24 chars — an exotic phrasing with a farther negator falls to the conversation-level
byte-identical-replay backstop, whose own trade-off is that a repeat format ask carrying an unrelated
negation streams grounded-data (same figures, narrated) instead of re-serving the dump; (e) the new
recipient header field reads LABELED lines only ("Bill to:", "Rechnungsempfänger:", "Kunde:" …) — an
address-block recipient with no label stays unextracted, and the recipient-shaped question then falls
through to the relevance path over the document text (by design, never a fabricated party).
Document redaction is AI-assisted best-effort, not a privacy/compliance guarantee (Skills S11d;
D73/D75/D78). The document-redaction skill's redact_document tool has two layers. (1) A
deterministic, offline regex floor always masks the clearly-shaped data — e-mail addresses, phone
numbers, IBANs, payment-card numbers, dates, and web links. (2) When a chat model is running, an
LLM locate pass additionally masks names, postal/street addresses, and organisation names: the
model only locates spans (grammar-constrained JSON, temperature 0), and the app verifies each
proposed string verbatim in the source and sweeps every occurrence — the model never generates
the output text, so it cannot invent or leak anything (the output is source bytes everywhere outside a
verified mask). A proposal not present verbatim, too short, or letter-less is dropped and counted.
The written file uses per-character █ masks (D74/D75), so line layout survives.
It still misses things (unusual formats, text inside images/scans — it sees only the extracted text,
and anything the model doesn't spot); the regex floor stays conservative (a false negative over
corrupting text). If no model is running, only the rule-based floor applies and the run says so
honestly (redactedFloor/cleanFloor → "offline rule-based detection only, no model running"). If
the model fails during the run (a crash, a freeze, an error), the run saves nothing and says so
(#620). The model reads the document in windows sized to its context, and a paragraph too long for
any window is read in overlapping pieces (#622), so long paragraphs are slower to check on a
small-context model but no longer fail; if a piece is still too long, the run says so and points to a
larger context size. The
redacted copy is a starting point that still needs a human review before sharing; the SKILL.md body
and the run's "done" copy both say so, and the app never describes the output as "fully anonymized" or
as meeting any legal/GDPR-DSGVO standard. Privacy posture is otherwise the strongest of the Tier-2
skills: the redacted text is written only to the user-chosen file, the detected values AND the
model-located entity strings never reach any log/audit/skill_runs row (the located strings ride as
tool input, which the gate never logs), and only per-category counts + a dropped-unverifiable
count are surfaced (architecture.md "Skills — design record" §21). Locate quality on a small local
model is the accepted risk — mitigated by the deterministic floor, the verify-verbatim + all-occurrences
sweep, and window overlap.
Targeted edits apply only find-and-replace changes found verbatim — never a rewrite (#23,
D76). The document-edit skill's apply_document_edits tool makes the exact find-and-replace
edits the user described. A running model is required: it only locates occurrence-anchored
find→replace edits (grammar-constrained JSON, temperature 0); the app then verifies each find
verbatim at its {line, occurrence} anchor and splices the replacement — the model never regenerates
the document, so it cannot invent, reword, or reorder anything. An edit changes only its anchored
occurrence (so an agreement like der → die only where it refers is precise), and everything the user
did not ask to change stays byte-for-byte identical (diff-verifiable by construction). A requested
change whose text is not found verbatim at its anchor is dropped and counted (surfaced as
editedPartial); if nothing matches, the run reports none and writes no file. With no model
running — or no instruction — the run refuses cleanly (there is no rule-based fallback for edits),
never a silent nothing. The instruction comes from the conversation's latest user message. Output follows
the source format (D77 — see the same-format-export bullet below): a Word .docx source
is edited in place and stays a .docx (formatting preserved); every other source produces a .txt copy.
Privacy matches redaction: the edited text is written only to the user-chosen file, and the
find/replace values never reach any log/audit/skill_runs row (they ride as tool input, which the gate
never logs) — only per-run counts are surfaced (architecture.md "Skills — design record" §22). The
edited copy is a starting point that still needs a human review before sharing; the SKILL.md body and
the run's "done" copy both say so.
Same-format export keeps DOCX as DOCX; other formats save as .txt (#22/#23, D77, #129;
architecture.md "Skills — design record" §23 + its 2026-08-09 supersede note). When the source is
a Word .docx, redaction and targeted-edit save a same-format .docx copy — styles,
numbering and tables survive because the app changes only TEXT content, never formatting markup.
Redaction covers the whole file's text since #129: the body (including tracked-changes
deleted text and field instructions), headers and footers (letterhead), footnotes/endnotes,
and comment text are all masked under the same rules, and the metadata PII carriers are scrubbed —
document author fields (docProps), tracked-change/comment author names, and hyperlink /
mailto: link targets (re-pointed at about:blank; masking only the display text would have
left the address recoverable on hover). What automatic masking still does NOT reach — and the
pre-run confirm now says so: pictures and scanned page images (including any text ON them),
embedded objects (spreadsheets, charts), and custom XML parts travel into the copy unchanged —
review the saved copy before sharing. A targeted edit deliberately stays a body-text change
(no header rewrite, no metadata scrub — it is not an anonymization). For a DOCX source the locate +
verify pass re-runs on the DOCX text layers (which differ from the extracted preview text), so
the masks/edits land in the text that is actually rewritten. A DOCX with no readable
word/document.xml (corrupt / unusual package) falls back to the .txt copy. PDF re-export is
out of scope (writing PDFs is a separate problem): a PDF or any non-DOCX source saves as
.txt (segment-faithful — the newline-preserving parser segments, so PDF line structure survives
as well as extraction allows, and per-char █ masks keep line length). A scanned / image PDF
has only its OCR text layer to work on — there is no reliable way to paint masks back onto the
page image, so such a document is best redacted from its .txt output, not in place. A DOCX
whose <w:t> runs split a word across multiple runs is handled (a span crossing a run boundary
splits across the nodes); a mask/edit never changes a paragraph break or formatting markup.
Said up front since #45: the pre-run confirmation dialog states the output format for the
selected document (derived from its extension, the same signal main branches on) — "keeps its Word
format (.docx)" vs "will be plain text (.txt) — the original layout and formatting are not kept" —
and, for redaction, the masking-scope line (#129) naming the unreachable content, so neither
the format cliff nor the privacy boundary is first discovered in the saved file.
Format-preserving PDF output remains open (true-redaction PDF or a regenerated, attributed PDF
would need a PDF-writing dependency plus a shipped embeddable font — neither exists in the tree;
see §5 next actions in BUILD_STATE.md).
Very large documents: the locate pass stops at a proposal cap and says so (#134). The
model-assisted locate pass collects at most 4,096 unique proposals per run (the tool input
bound; duplicates from the overlapping windows are collapsed first, so the cap binds on genuinely
huge PII-dense documents — a member/address list, not a normal contract). A run that hits the cap
completes — it no longer fails with a generic error after the full multi-minute pass — and the
outcome copy says detection stopped at its limit ("later items may be unmasked" / "later places may
be unchanged"), asking for a whole-copy review. The deterministic regex floor still runs over the
entire document regardless (e-mails/IBANs/phones/cards/dates/links are never subject to the cap).
Date masking now accepts EITHER field order and a 2-digit year — the BL-N6 leak is closed (U2,
audit §5.7). For redaction (unlike extraction, which stays day-first) a candidate is masked when it
parses in day-first OR month-first order, so a US-orderedmm/dd/yyyy value like 12/31/2026
now masks alongside its EU counterpart 31/12/2026, and a two-digit-year form like 01.02.26 is a
candidate and masks too. Over-masking a date is the intended posture here (a privacy-favouring miss
is worse than an over-broad mask on a date-shaped token), the inverse of extraction's day-first-only
stance — an impossible date (99.99.9999) still parses in neither order and is left alone. There is
no path where masked text is un-masked or a detected value reaches a log/audit (the privacy posture
is unchanged). Residual: a locale-aware, opt-in-by-category matcher is still part of the deferred
higher-recall wave; the current all-orders masking is deliberately broad.
Payment-card PANs are masked with a Luhn check (U2, audit §5.7). A 13–19 digit run in the common
print groupings (compact, or single-space/dash-separated groups — 4111 1111 1111 1111,
4111-1111-1111-1111) is masked as [CARD] when it passes the Luhn mod-10 check with its separators
removed. The Luhn gate keeps false positives low; a run outside 13–19 digits (e.g. a 20-digit account
number) or one that fails Luhn is left alone. Cards are masked before dates and phones so a PAN is
never split by them, and after IBANs so an IBAN's BBAN digits are not re-read as a card. A card that
fails Luhn (or one printed in an unusual grouping) is a documented miss — the conservative posture stands.
Phone and IBAN coverage is broader but still pattern-bound. Phone
masking catches punctuated US/national 3-3-4 numbers (555-123-4567, 1-800-555-1234,
555.123.4567) on top of the +-country and leading-0 forms — but punctuation is required (a
bare 10-digit run is left alone to avoid masking account/ID numbers), so a space-only or run-together
national number can still slip. U2 further guards the 0-leading branch (audit §5.7): a
separator-less run of ≥9 digits that begins with 0 is a reference/account number (a 0-leading
invoice reference), not a phone, so it is left unmasked — this fixed the share-flow false positive
that corrupted invoices; a 0-leading number with a separator still masks. The tradeoff is that a
run-together 9+-digit 0-leading phone is now missed (the privacy-favouring choice over corrupting a
figure). IBAN detection is case-insensitive (a lowercase compact de89… is masked), but a
mixed-case space-grouped IBAN (unconventional) is not specially handled. The case-insensitive compact
candidate matches a standalone alphanumeric run and is re-validated by per-country length after
compacting, so a real IBAN glued to following alphanumerics with no separator (de89…013000extra,
which does not occur in space-separated extracted text) fails the length check for a known country and
is left unmasked — a documented residual. These remain best-effort regex detectors — the conservative
miss-over-over-mask posture stands.
Unicode print variants + the parenthesized US phone now mask (R8, skills-audit-2026-07-03 SKA-3).
The detectors used to run on the raw byte-verbatim text (D58), so the common Unicode print separators
defeated exactly the identifiers redaction exists to mask: an NBSP/narrow-NBSP/figure-space-grouped
IBAN or card yielded zero candidates, a phone with the non-breaking hyphen U+2011 Word
auto-inserts (or an en dash) never matched, and the most common US form (555) 123-4567 had no
branch — while the U2 dry-run/share-safe counts reported 0 for them. R8 closed this with a
same-length detection shadow (match on a 1:1 ASCII-normalized copy — NBSP family → space,
U+2011/U+2013/U+2212 → - — mask the original bytes at the same offsets), so the unmasked remainder
stays byte-identical and every existing guard (Luhn, per-country IBAN length, the 0-leading reference
guard, the punctuation anchors) applies to the Unicode twins unchanged; the (ddd) ddd-dddd branch
was added punctuation-anchored. The R8 review hardened the mechanism (see security-model.md R8
note): a shadow-joined neighbour (one NBSP away) can no longer UN-mask the IBAN/PAN inside a
failed whole-span candidate (sub-span narrowing), and en dash / minus in the original bytes are
range/math typography, never phone/card punctuation on a non-+-led, non-parenthesized match —
so Budget 10.000–15.000 EUR, 05.2025–06.2026, PLZ 01067–01099 and a Luhn-lucky en-dash
invoice-number range stay untouched. Deliberately still out: an en-dash-set bare/0-leading
phone (Tel. 0664–1234567) is missed (the refusal above — miss-over-eating; the U+2011 and
+/parenthesized en-dash forms mask); exotic Unicode separators beyond the six
mapped print variants (e.g. hair/thin/ideographic spaces, U+2014 em dash as a digit separator),
spelled-out numbers ("null sechs sechs vier…"), and RTL/bidi-reordered digits — the shadow maps only
what real PDF/Word pipelines emit around identifiers; anything else remains the documented
best-effort miss (the deferred higher-recall wave). Two residuals shared with the ASCII twins
(unchanged by R8, now reachable via NBSP/figure space too): digit table CELLS joined by a single
separator can merge into a Luhn-lucky [CARD] or a generic-country [IBAN] over-mask
(privacy-favouring direction), and the review surfaced a pre-existing super-linear
backtracking hazard in IBAN_CANDIDATE_RE's grouped alternative on hostile uppercase runs
(multi-second on a ~500 KB adversarial document, R7-identical, neither caused nor worsened by
R8) — an open candidate for the same linear-matcher treatment as the trigger guard above.
Informational dry-run + share-safe pre-scan. An INFORMATIONAL redaction
question ("welche personenbezogenen Daten enthält das Dokument?", "what personal data is in here?")
over a single document now gets a read-only counts answer (scanRedactionCandidates — the same
detectors, run without writing a copy; per-category counts only, never a detected value) instead of the
button deflection; an action ask keeps the deflection (the write tool stays user-initiated). The
share-safe-review whole-document turn injects a deterministic whole-document PII count summary into
the model prompt and gates its "Likely low risk after review" verdict on non-truncated coverage —
a truncated read (the model was shown only the beginning) forbids the low-risk verdict. An
over-budget document with NO tree is covered whole via the chunk
map-reduce, whose reduce turn carries the pre-scan block with NO gate (whole-doc coverage legitimately
permits the low-risk verdict) — so the pre-scan now reaches the common over-budget case. Residual: a
share-safe review of an over-budget document rescued via the deep-index tree map-reduce still does
not carry the pre-scan block (a narrower edge case — ≥~50-page docs with a ready tree; its own coverage
stamp still marks any truncation).
Spec features intentionally not built (MVP scope)
No dedicated Onboarding wizard (spec §7.1). The WorkspaceGate (create-password / unlock),
the automatic first-run benchmark, and the Home screen together cover the spec §17 first-run flow.
Answer-depth accepted edges (the modes themselves shipped — architecture.md
"Chat & streaming"): the depth choice is per-conversation per session (not persisted
to the DB), and document answers always run Balanced (deep-grounded answering is an open
question).
Model state not_recommended is declared but never produced (no code path sets it; it exists
only in the display map). ready is declared and rendered, but the current runtime goes straight to
running after start, so ready (loaded-but-idle) is never produced either.
Settings lacks the spec §10.6 Models/Performance/About sections (Models has its own screen;
Diagnostics shows version/runtime/model info).
No sample-contract.pdf fixture for the canonical spec §17 demo script.
Manifest field supports_tools is unused (supports_thinking_mode is load-bearing — it
gates the Deep answer mode; bundled_on_preconfigured_drive picks what a Kit preloads, #766).
In-app downloader accepted edges (the downloader shipped — architecture.md
"In-app model downloader"):
A download or install keeps running after a lock, and the offline tripwire records its new
connections. The network gates are read when a job starts. A workspace lock leaves running
jobs alone on purpose (BE-2: the weights live outside the vault). The tripwire asks at every
remote connect whether the app is offline (#758), and a locked workspace reads as offline, so
each connection such a job opens after the lock (a model's next file, a redirect) shows as
"Network attempt noticed" in Diagnostics → Activity. Before #758 the tripwire was decided once
at startup: on an encrypted workspace it recorded every download the user accepted, and a
restart did not help, since such a workspace always starts locked. Switching "Allow internet
access" off is different: it stops the job (#782, architecture.md "In-app model downloader").
A policy file edited while the app runs does not stop a running download or install. The
Privacy screen reads policy.json live, but nothing watches the file, so a job already running
finishes; the next one is refused. The tripwire records the job's new connections. Owner call
(#782): an admin edits the policy before handing the drive out, not mid-download.
Download job state is per-app-process. The job runs in the main process and survives
navigation; since #314 it also survives a renderer reload — the screen re-attaches on
mount via downloads:list (the live job, or the most recent undismissed failed/unverified
result), and a dismissal made before the reload stays dismissed. An app restart still
loses every job: nothing about a job is persisted, so the progress card and a failure's text
are gone, and the kept .part resumes only on the next manual Download click.
A manifest size_bytes more than ~25% below the real file truncates the download
(BUG dl-size-cap-2026-07-03). size_bytes feeds a disk-fill body cap; the cap is now
drift-tolerant (size_bytes + headroom), but a grossly-understated size still trips it near
completion and then the resume fails the checksum. This is a manifest-data bug, not a
downloader bug — capture the real hash + exact size_bytes with verify-models --generate (or
from the HF LFS X-Linked-ETag/X-Linked-Size) from the actual file. (Instance now fixed: the
Qwen3.5 27B/35B wave hashes were wrong and their sizes understated by 5–8%; corrected 2026-07-03
with real values captured from HF LFS — the 9B was already correct.)
Resume does not send If-Range. A weight re-uploaded upstream between an aborted attempt
and a resume splices two revisions and fails the checksum. It self-heals by discarding the .part
and re-downloading, but does not detect the change up front — an accepted residual until
If-Range/ETag revalidation lands (the Content-Range start is validated, which catches a
wrong-offset 206 but not a same-offset content change).
A complete but un-renamed .part recovers in place (no 416 dead-end). A cancel/crash during
the minutes-long hash verify, or a failed final rename (e.g. an AV lock on the destination), can
leave the WHOLE file staged as <weight>.part. Resuming it would send an unsatisfiable Range: bytes=<fullSize>- — every HF/CloudFront/S3-class origin answers HTTP 416, which used to loop
forever with no in-app remedy (F-13, full-audit 2026-07-16). The downloader now verifies a
complete .part in place instead: a matching hash renames it into place, a mismatch discards it
and restarts clean (the same treatment as a wrong-offset 206).
Drive updates are manual — signed offline update bundles (spec §12.3) are not built yet;
there is no update mechanism. The updates/ and workspace/backups/ directories
are not created. The manual procedure is documented in drive-layout.md
("Updating a drive"). Blocker: the key-management design — who holds the signing key and
where it lives (dev-machine key vs. an offline-born production key; HSM/hardware-token class
questions), what public key drives trust (and whether DIY drives trust a repo key or generate
their own), offline key rotation/continuity, and rollback protection. Deliberately not yet
decided; the update-bundle work needs its own short design doc
(outline in BUILD_STATE §5) before any code.
One constraint already understood from that discussion: a trust anchor cannot be
retroactively strengthened, so whatever key signs during development must never anchor
commercial drives — the production key would be a different, offline-generated key.
On RAM-constrained machines every model start re-reads the full GGUF at media speed — warm
starts included (issue #107). llama-server maps the weights with mmap; when the model file is a
large fraction of total RAM, the page cache cannot keep the previous load's pages resident, so a
"warm" start reads the file again end-to-end exactly like a cold one. Measured on a 16 GB laptop
(i7-8550U, CPU-only, volume-level IO tracing): the 4B (2.9 GB) from a 70 MB/s USB stick loaded in
44 s cold and 42.7 s warm (2.71 GB re-read); the 9B (6.0 GB) 98.7 s cold, 87.9 s warm (5.56 GB
re-read); the same 9B from an internal SSD 14.4 s cold, 11.6 s warm (6.84 GB read — more than the
5.97 GB file: paging rework). On a 128 GB machine the same warm start takes ~3 s — a
memory-pressure effect, not a media effect. Consequences the app now surfaces honestly instead of
hiding: the measured effective read speed drives Diagnostics + the slow-read warning (#108/#110),
and the "Starting…" panel shows approximate progress from that measured speed (#107). Since #114
a concurrent sequential prefetch primes the page cache at full media speed alongside the mmap
load (validated on-hardware first: −49% cold start on a slow stick, −36% on a USB SSD, measured
on exactly the 16 GB box class the memory-pressure risk targeted — the feared self-eviction did
not defeat it; architecture.md "Concurrent weight prefetch (#114)"). The warm-start full re-read
on RAM-constrained machines remains a fact of mmap + memory pressure — the prefetch makes it
cheaper, not free.
Text / Markdown / CSV imports are capped at 64 MiB, separately from the 1 GiB document ceiling
(architecture.md §35). Those parsers
read the whole file into one UTF-16 JS string (CSV then derives the papaparse row array + the rebuilt
joined text — ≈3 full copies at once), so a file near the 1 GiB maxBytes would exceed V8's ~512 MB
string limit and OOM-crash the main process. The textMaxBytes ceiling (env HILBERTRAUM_TEXT_MAX_BYTES)
makes an oversize text/CSV file hit the friendly "file too large" reject instead. PDF/DOCX/audio/image
keep the full maxBytes (they stream / are page-bounded). A streaming line/row parser would lift the
cap; the byte ceiling is the safe interim win.
Text and CSV exports carry a UTF-8 BOM (.md/.txt/.csv) — deliberate Windows/Excel
friendliness, visible to strict non-Windows tooling.bomFor (invoice-hardening P4 for md/txt; audit-2026-07-16
F-10 / owner decision D-A 2026-07-17 for csv) prefixes U+FEFF so CP1252-defaulting editors and
double-click Excel detect the encoding instead of garbling umlauts/ß. The app's own round-trip is
clean: the md/txt parsers strip one leading BOM on import (F-22) and the CSV importer (papaparse)
strips it itself — but a strict external consumer that treats bytes verbatim (a naive cut/awk
pipeline, some JSON-adjacent CSV loaders) will see U+FEFF glued to the first header cell. The BOM
follows the chosen file's extension, not the kind of export: .json, .xml and .log files never get
one (it breaks strict JSON parsers and log tooling), but the diagnostic-log export defaults to
hilbertraum-logs.txt and so carries one unless the user picks .log.
The documents list is windowed, so the browser's find-in-page (Ctrl+F) only matches rows that are
currently rendered (architecture.md §36).
To stop the list DOM (and the per-row Radix menu-root state machines) from growing linearly with library
size, the documents list virtualizes with @tanstack/react-virtual — only the rows in/near the viewport
are mounted. An inherent windowing trade-off is that Ctrl+F can't find a document whose row isn't mounted;
the in-app section / smart-view filters (which narrow over the full library, not just the visible rows)
are the intended way to locate a document by name/attribute. Windowing engages only when a real scroll
viewport is laid out — with none (e.g. a unit test rendering the screen standalone) the list renders every
row. The trade-off is deliberately not applied to the chat transcript (see the next bullet).
Windowing bounds the DOM
only, not the payload: the backend listDocuments still loads and ships the whole library per
refresh (no LIMIT, unindexed created_at sort) — fine at ≤~1k documents, a multi-MB IPC payload
at ~10k; revisit together with the ocr_json projection migration (the recorded DB-8 residual)
if a library approaches that scale (full-audit 2026-07-10 PF-5, watch-item).
The chat transcript is not virtualized: switching to a very long conversation re-parses its
whole history, a visible stall at several hundred messages (accepted — frontend audit
2026-08-09 CH-11, decision recorded per #148). The transcript deliberately remounts per
conversation (key={activeId}, the CR-2 fix — stale-scroll/announcer state must not leak across
chats), so every switch re-renders and re-parses (Streamdown/KaTeX) every message; persisted
turns are memoized within a mounted conversation, so only the SWITCH pays. Windowing is declined
for now because the transcript's scroll-to-bottom contract, browser find-in-page over the whole
history, and the StreamAnnouncer's live-region behavior all assume an un-windowed DOM — the same
reasons the documents-list windowing was not extended here. Typical conversations (tens of
turns) switch instantly; revisit (window or cap old messages) if compaction-era conversations
routinely reach hundreds of turns.
Chat "Try again" optimistically drops the last answer before regenerating; it self-heals, never
data loss (accepted).ChatScreen.onTryAgain slices the last
assistant turn from the view before calling stream(...), so the regenerate looks immediate. If the
regenerate IPC throws before the backend mutates, or the user switched conversations, that answer
is briefly missing from the view while the DB still holds it. It is restored without any manual
action: stream's catch re-reads listMessages(convId) in place when the user stayed on the
conversation, and the activeId-change effect re-reads on return when they switched away. Deferring
a "defer the slice / force-refresh on failure" change keeps the immediate optimistic feedback.
(architecture.md "Renderer robustness" Phase D.)
The session-boundary DB unlock/lock decrypt is still synchronous (PERF-1 scope; architecture.md
§35). The per-import document-cache crypto was made async (yields between 8 MiB chunks, so a large
import no longer freezes the main process). The whole-DB decrypt on unlock / encrypt on lock — once per
session, not per import — stays on the synchronous path because the uncaughtException crash-lock must
re-encrypt the working DB beforeprocess.exit (an async lock couldn't finish first). On a very large
workspace DB the unlock screen / "Lock now" can therefore still pause briefly; adopting the async vault
siblings there (keeping a synchronous crash-lock) is a tracked follow-up.
The per-import jobs map in registerDocsIpc is never pruned (tiny, ephemeral, per-process).
Orphaned document sidecars (workspace/documents/<id><ext>.enc with no matching documents
row) are never swept: the startup crash sweep matches only transient .parse/.tmp names, and
it runs while the encrypted DB is still locked, so it cannot know which ids exist (full-audit
2026-07-12 SEC-1, sweep half deliberately left out). Post-SEC-1-fix an orphan can only be a
REAL-key encrypted leftover (a lock landed between a finished sidecar write and its
stored_path UPDATE, and the failed row was then deleted) — unreadable ciphertext wasting a
little disk, not a confidentiality issue.
getSettings does not type-guard stored JSON values (the privacy-critical network path is
double-gated by the policy AND). The write gate in updateSettings now also rejects null for
non-nullable keys and shape-checks the null-default keys (bounded strings for the model ids /
gpuLastError; lastBenchmark/benchmarkHistory/gpuProbe/modelPlacements are VALIDATED
field by field on read and write since the PR #303 audit, not merely shape-checked as plain
objects — shared/benchmark-schema.ts, H1/L8, owner decision G7), and the checksum-cache reader
degrades a pre-existing corrupted row to a cache miss (BE-1, full-audit 2026-07-10).
The import walk (expandPathsBoundedAsync) follows directory symlinks during import expansion.
Sidecar port selection has a small TOCTOU window between findFreePort() and the spawn.
LlamaServer.start retries a bind-class immediate exit ONCE on a fresh port (REL-1), and a
transient bind race no longer arms the embedder/reranker start-latch (F4/F7) — so a single port
collision self-heals; a losing-twice race fails just that one call (the next retries). The startup
error is diagnosable via the captured stderr tail.
The shell scripts re-implement logic whose canonical source is TypeScript (drive.ts,
assets.ts, commercial-drive.ts). Parity is maintained by convention + review,
not code generation — see the rule in ../CONTRIBUTING.md.
Docs copied onto a prepared drive (user-guide, troubleshooting) contain repo-relative links that
do not resolve when read from the drive.
Audit log accepted edges: events recorded while the vault is locked are
buffered in memory only — quitting the app before the next unlock drops them (bounded buffer,
oldest dropped past 100). The persisted audit log is also capped (AUDIT_MAX_ROWS = 5000,
pruned back to the cap once a small slack above it is exceeded — full-audit 2026-07-10 PF-3), so
on a very active workspace the oldest events fall off over time.
Lock-on-quit and the implicit stop during a model switch are
not audited (only the explicit "Lock now" / stop actions are). A download that completes
against a placeholder manifest hash records no model_download_verified event (checksum
honesty — the AI Model screen shows UNVERIFIED).
Document import / re-index events no longer name the file.
The Activity panel rows read a plain "Document imported" / "Document re-indexed" instead of
interpolating the title/basename, because a user-chosen filename is content (it can be as
sensitive as the text it labels) and the whole log is exported verbatim by the plaintext
activity-log.json action. The event still records the documentId + status + chunkCount,
so the row is fully resolvable from inside the app; only the human-readable name is withheld
from the log, matching the chat (conversation title) and collections (project name) channels.
Saving an export REPLACES the chosen file; it never writes into it. Every export written
through the shared atomic writers — the audit-log, diagnostic-log, transcript, result-table,
code-block and document-original exports, and since #838 every skills export (the
transactions and invoice CSV, invoice JSON and XML, the redacted and edited copies, the DOCX
copy) — goes to a temporary sibling file, is flushed to disk, then renamed over the
destination, so a failure leaves no partial file and the file being replaced intact. The
trade (the evidence pack's AUD-17 posture, see "Evidence review & evidence packs"): (1) the
temporary name is the destination plus a ~37-character token, so on a default Windows setup
(LongPathsEnabled off) a destination within that margin of the 260-character path limit
fails cleanly at the temporary file's creation (recovery: a shorter path); (2) the result is
a NEW file: a destination that was a hard link is no longer linked (its other names keep the
old content), a symbolic link is replaced by a plain file (its target is untouched), and the
old file's ACLs and macOS extended attributes do not carry over; (3) the folder must allow
creating a file — one that allows overwriting existing files but not creating new ones
refuses the export, and on macOS/Linux a read-only destination in a writable folder is
replaced; (4) on Windows a destination held open without delete sharing (Excel keeps a CSV
open that way) refuses the rename, and the old file stays.
The E5 embedder runs WITHOUT its query:/passage: prefixes — a retrieval-quality ceiling,
not just a floor problem (backend-audit-2026-06-27 DOC-3; rag-design.md
§12.1). The model card prescribes asymmetric prefixes; omitting them compresses every
embedding into a narrow cosine band, which has two consequences a maintainer hunting a
retrieval-quality caveat should know. (1) ragMinSimilarity stays 0 — a positive cosine floor
is impossible (MEASURED 2026-06-10, §12.1 R3): on the real D:\ drive the relevant and
irrelevant best-chunk cosine distributions OVERLAP (the ~0.87–0.94 band), so any positive floor
drops real hits. (2) The reranker is load-bearing for relevance, not optional polish:
relevance separation is delegated to RRF + the reranker (D12), so a workspace without the
reranker GGUF provisioned keeps the raw, less-separated ordering. Latent improvement: a prefix
migration would spread the distribution and make a floor meaningful (and lift the ceiling), but
forces re-embedding every corpus — revisit only as a deliberate migration.
Cross-language search covers German questions over English documents only (#1003, follow-ups wave 7;
rag-design.md §20). When none of a German question's best six passages reads as German and most
of them read as English, the app asks the loaded chat model for an English translation of the question and searches
again with the question and its translation together. A passage whose language the detector cannot read (a table, a
letterhead, a signature block, an address line) does not block this, but it counts against the English majority;
passages are read without the question's umlaut rule, so a German address in an English lease is no German passage.
Measured on the search alone over an English lease, the answering passage reached the top 3 for 25 of 38 fresh
German questions (today 10, a reference translation 27). It costs one short model call on such turns only: measured
p90 0.5 s with the 4B and 1.2 s with the 9B on a GPU, and 3.3 s with the 4B on the CPU alone on a quiet machine
(about 9 s on a busy one). What it does not cover:
an English question over German documents: the 4B's translations into German measured below the bar (77 % of a
reference translation's gain), so that direction stays as it was;
the other eight interface languages, and a short question with no function word («Miete?», "IBAN?"), whose language
the detector cannot read;
a scope with a German passage among its best six, or one where English passages are not a strict majority of them:
the search stays as it was;
a question longer than 150 characters: it is not translated (past the measured range the reply cap could cut the
translation), so the search stays as it was;
a failed call: past 8 s, on a malformed reply, on an error, or when the second search finds nothing or fails, the
search falls back to today's silently, with no notice;
the keyword search reads only the first 32 words of its query, so it gets the translation first and the question
after it. A question (up to 150 characters) whose words and its translation's together pass 32 loses its own last
words from the keyword search (the vectors still read all of it). Every measured question fitted;
an English question with a German-looking word reads as German ("Who was Hans Müller?": "was" counts as German and
the umlaut breaks the tie), so over English documents it pays one call. When the model hands the question back
unchanged, no second search runs and the answer is the same;
a raised ragMinSimilarity (default 0) filters the vector hits of the joined text too; how that plays out is not
measured. And when it leaves the first search with no passage at all, the answer is the fixed "not found" reply
and no translation is tried;
the 8 s bound starts when the call is made, before the one chat slot takes it. While the slot is still ending a
local-API generation (about 5 s at most) or holds another queued request, the bound can run out first, and the
search falls back silently;
the answer budget: the step lifts German questions to the English level, not to every answer. The 4B at 4,096 tokens
has room for 2–3 passages, and even in English the lease's answering passage was among the top 2 for only 9 of 18
questions;
a wrong translation (the 4B once gave "terminate" for «abschließen») adds wrong words to the search; the question's
own words stay in it, and none of the wrong translations in the held-out check ranked a passage below today's;
the second search can still move a passage down a little: in the held-out check 4 of 60 questions had theirs one or
two places lower than before with the 4B (2 with the 9B), while 15 more lease questions reached the top 3;
the extra call runs in the one chat slot, so it may evict the answer's cached prompt prefix, as the knowledge-pack
planner's call does (not measured). It does not count as the model's first answer for the warm-up hint; the
knowledge-pack planner's call and the skill classifier's call still do (as before #1003).
Reranker latency on CPU is significant (MEASURED): ≈ 24.7 s worst case for a 12-candidate
batch at the full truncation budget on a CPU-pinned i7-1185G7 (~2 s/candidate;
HILBERTRAUM_RERANK_SMOKE, 2026-06-10) — a documents query visibly lengthens on a low-end laptop when
the reranker is provisioned. Bounded, on the capped scope (step 4-4's default; see the
profile rule immediately below for the gpu/cpu-hi widenings), by the candidate cap
(≤ 2×topKInitial) + word-truncation budgets (the tuning levers); the reranker stays an
opt-in (provision-the-GGUF) feature, never
bundled by default. The HILBERTRAUM_RAG_QUALITY run is the evidence it earns the cost
(rag-design §12.3). The rerank hardware-profile rule (step 4-4, rag-design.md §17 PR-B
record) follows from this cost: on a usable GPU the reranker sees every fetched knowledge-pack
block essentially for free (run L, 2026-09-15: GPU all-scope rerank p90 2.67 s for a mean 118
documents, max 410); on a CPU-only machine the wider top48 opt-in (ragRerankWideScope)
ships disabled for everyone — run L measured its rerank p90 at 25.3 s at 8 threads and 29.1 s
at 16 threads (16 threads was NOT faster than 8 on this measurement), both roughly 2.3–2.7× the
10.8 s bound the ruling set, so CPU_HI_MIN_THREADS is frozen at Infinity and the cpu-hi
profile is unreachable by any real machine until a future re-measurement lowers it. Every
CPU-only machine keeps today's capped scope regardless of thread count.
The reranker's GPU posture is gated on provable headroom, AND a small card now gets the fast,
bounded scope instead of a 512-document wide scope run through a CPU reranker (step 4-5, Wave 5
ruling (d); step 4-6, Wave 6 ruling (a)) — but the gate itself is still UNVALIDATED on the
small-card hardware it exists for. Step 4-4 launched the reranker with no --device argument
(llama-server's own ngl-auto + --fit) whenever gpuUsefulForProfile found any usable card —
a predicate that never checked whether there was room for a SECOND resident model beside the
chat model. Step 4-5 replaced that check: rerankerDeviceFor (rag/rerank-profile.ts) now
requires the budget device's free memory, minus the active chat model's own placement estimate,
to clear the reranker's own estimated need (≈ 2.8 GiB, RERANKER_HEADROOM_FLOOR_MIB) before
choosing the GPU posture — an unknown probe, no useful device, no budget figure, no active model
or an unresolvable manifest all mean CPU. Step 4-5 deliberately left the candidate SCOPE alone
when it did this, which left a gap the scoped Opus review caught (finding C1): a small card
could still resolve the gpu PROFILE (and therefore up to 512 documents in one rerank call)
while the sidecar it was about to call correctly started on the CPU — a combination that, per
run L's own CPU figures (top48 at 48 documents: p90 25,317 / 29,101 ms), would routinely
exceed the 120 s request timeout. Step 4-6 (Wave 6 ruling (a)) closes that gap: the resolved
posture now feeds the scope decision too, through one shared helper both the sidecar and the
per-ask scope call — gpu profile + cpu posture now resolves capped (today's bounded,
~12.9 s p90 scope), never the wide, unbounded one; cpu-hi and default are unaffected. Proven
a no-op on the project's own measurement machine before landing (its posture stays gpu, so its
scope stays all, unchanged). What this does NOT close: the project's only measurement
machine is a 12 GiB card (ample headroom for both models at once), so no acceptance read has
ever exercised the gate's cpu-posture branch live — the 5–6 GiB laptop class
architecture.md's USABLE_VRAM_MB record already discusses. See step 4-5's
hardware-leg.json: no such machine was reached in this session (available: false), so
the gate ships on the ARITHMETIC alone (the same estimator the picker and the fit budget already
use elsewhere, not a new one invented for this gate) plus rerank-profile.test.ts's fixtures
(real device/manifest figures, including the #318 RTX 3060 Laptop's own totalMb) — not yet
confirmed by a live small-card run. Scoped Opus review of step 4-6, observation O1:resolveAskCandidateScope now does one small, uncached synchronous filesystem read per ask
(findManifestById → discoverManifests, a directory walk + YAML parse over the model
manifests) to reach the shared posture helper — measured 26.2 ms first call / 11.5 ms warm p50
on local NVMe over the repo's 35 manifest files; negligible against a multi-second ask, and
directed by Wave 6 ruling (c) itself, but new and worth naming since models.ts already flags
this call as a real read on slow portable-drive media (#333). Scoped Opus review of step 4-6,
finding C2, resolved by step 4-7 (Wave 7 ruling (a)): the shared helper above guarantees the
sidecar and the per-ask scope compute the SAME posture from the SAME inputs, but not at the
same MOMENT — the sidecar resolved its posture once per cold start and held it for the session,
the ask re-resolved on every ask, and only a gpuMode/gpuAutoDisabled flip suspended the
resident sidecar, never an activeModelId change (though activeModelId also feeds the
posture, through chatModelNeedMib). Reachable concretely on the project's own measured GTX
1070 Ti ({totalMb: 8273, freeMb: 7504}, #391 leg 2): starting on the 9B chat model (this
card's own starred recommendation) gives posture cpu; switching down to the 4B — an ordinary
Models-screen action — moves the posture to gpu with nothing to suspend the sidecar, so the
next ask could resolve the wide all scope while the sidecar stayed resident on the CPU — C1's
combination again, through a drift window. Step 4-7 adds activeModelId to the suspend trigger,
fired from models:select and runtime:use through one shared predicate
(rerankerPostureInputsChanged, rag/device-posture.ts), the one settings:update uses for
gpuMode; settings:update fired it for activeModelId too until #868, which drops that key
from a renderer patch. activeEmbeddingModelId is explicitly not a posture input and never
triggers it. The honest residual: this is not an absolute guarantee for every ask in
flight — suspend() is fire-and-forget, so an ask landing mid-teardown hits the sidecar's
tearingDown guard, its rerank() call fails, and Wave 5 ruling (e)(i)'s cappedCandidates
fallback returns the capped selection instead; that one residual window resolves toward the
safe, bounded scope, never the wide one. The small-card posture branch itself remains
unvalidated on real hardware, as above.
Scoped Opus review of step 4-7, finding C3, RESOLVED by step 4-8 (Wave 8 ruling (a)):activeModelId was never a safe posture input in the first place — it is a proxy for "the chat
model that will be loaded", true only once runtime:use's multi-GB weight hash and load finish,
and false for the whole window before that (the file's own comment calls this "the long
pre-start window", minutes on a cold checksum cache). Step 4-7's event-time suspend fired at the
START of that window, on the OLD model, then held the posture for the entire hash + load — so a
down-switch (e.g. the project's own measured GTX 1070 Ti, {totalMb: 8273, freeMb: 7504}: the
9B running at posture cpu, switching to the 4B) could cold-start the reranker on the GPU beside
the still-resident, still-running OLD (larger) chat model. The posture's chat-model input is now
the RUNTIME's COMMITTED model (RuntimeManager.activeModelId()), never the setting — during the
hash window the committed model is still the OLD one, so the posture stays correct throughout by
construction, not by a suspend's timing. A chat-model start in flight or PENDING (a per-call
counter in startModelRuntime, covering the window it spends awaiting the reranker's own
single-flight suspend before the load) also forces cpu, closing the narrow gap between the
commit and the load itself. What makes this hold at every MOMENT, not just at a suspend-covered
event, is the reranker's own use-time re-check: it resolves its posture fresh before every
rerank() call (and again after any await inside one), so a resident sidecar recorded under a
stale posture is restarted before serving a request, under race rules that never join a teardown
they did not start, never restart twice in one call, and never let another caller's abort end an
ask that should instead fall back to the capped, bounded selection. Six residuals remain,
disclosed rather than fixed:
r1 (translation occupancy): a GPU-posture translation sidecar occupies the card while
loading and while tearing down (hard or idle), not only while resident — the reranker's gate
now sees all four stages, so a GPU rerank never cold-starts beside an unbudgeted translation
occupant, but this is translation's own --fit auto-offload policy doing the same thing it
already does beside the chat model on master; nothing new to this step.
r2 (the gate's manifest-only chat-model estimate): unchanged from the note above —
estimateGraphicsNeedMib reads the manifest only, so raising the launched context window
increases the chat model's real VRAM use without moving any posture input.
r3 (other GPU consumers, a stale probe, and NVIDIA/Windows' constant freeMb): unchanged
from Wave 5 ruling (d)'s own disclosure above — other applications' GPU use is invisible to the
gate, a stored probe can go stale between refreshes, and on NVIDIA/Windows the reported free
memory does not reliably track what the app itself has already loaded.
r4 (a GPU cold-start failure, or a second unexpected crash, disables reranking for the
session): the reranker sidecar now drops a dead handle after one unexpected mid-session exit
(a driver reset, VRAM/RAM exhaustion) so the next rerank cold-starts fresh with a freshly
resolved posture — but a SECOND unexpected exit in the same session, or a genuine GPU cold-start
failure, still latches reranking off for the rest of the session (the existing failed-start
latch policy, unchanged). There is no GPU→CPU demotion path; a follow-up issue proposes one.
The Performance card summary line omits a GPU-resident reranker: the line stays "chat +
translation" (unchanged shape); a reranker resident on the graphics card (now visible in its
own row) is not folded into that summary total. A follow-up issue proposes fixing or
disclosing this directly in the UI copy.
T's declared cost (Phase 2 ruling (d)): a GPU-posture translation sidecar can cost the
reranker at most two cold starts per translation episode — one on the first ask while
translation occupies the card, one on the first ask after it idles out 120 s later. This is a
declared deviation from Phase 2 ruling (d)'s literal per-question latency bound for those two
asks; it is the same KIND of cost master's first ask already pays once per session (a cold
start). The cold start's own duration is not recorded by any existing measurement artifact
(run-summary-a4-gpu.json's gate has no timing field; m2-latency.json records rerank request
latency, never a cold-start duration) and this step runs no inference, so it is stated as
unmeasured rather than invented; a behaviour-neutral memo of the manifest read itself was
measured at 15.5 ms warm p50 on the drive layout (K:), well under the 50 ms threshold that
would have required one, so none was added. Since #473 (2026-10-07) the first of the two
moves EARLIER: a GPU-posture translation cold start suspends a reranker resident on the card
before it spawns (the chat model switch already did this), so translation's --fit no longer
sizes itself against memory the reranker holds. The count is unchanged — the reranker's next
ask cold-starts on the processor, and it returns to the card after translation idles out. A
reranker on the processor, or not resident, is left alone. A reranker still mid-way through a
GPU cold start when translation starts is not stopped; its first ask moves it as before.
No 5–8 GiB card was available in this session either (Wave 8 ruling (i)'s hardware leg is
optional and not blocking): the small-card branch and the fail-vs-spill question above remain
unvalidated on real hardware, unchanged from step 4-7's own disclosure.
The all rerank scope is capped, and a rerank-call failure now falls back to TODAY's
baseline instead of landing below it — both measured, neither asserted (step 4-4's finding,
step 4-5's fix). Step 4-4 shipped all with no per-call document ceiling and no dedicated
fallback: a rerank-call failure kept retrieve()'s existing catch path (the fused order, then
the no-rerank interleave) over the WHOLE wide, un-cross-encoded pool. Measured cost: the
gpu acceptance read's own no-rerank column packed FEWER gold blocks than the shipped
capped/no-rerank baseline — allPacked 26→22, anyPacked 42→33, goldSpanInPacket
142→116 — a wide lexical pool with no working cross-encoder was measured WORSE than
shipping no rerank at all, the reason rerankScopeFor always returns 'capped' with no
reranker provisioned. Step 4-5 (Wave 5 ruling (e), B3 with B7/B20) fixes both halves: (1)
ALL_SCOPE_MAX_DOCS bounds the TOTAL a single rerank call may see — run L2 (a two-pack
development latency read) selected 512 (every cell in {192,256,384,512} cleared the
10,848 ms bound with wide margin: p90 by cell 2,251/2,763/2,870/2,816 ms; the genuinely
uncapped two-pack distribution itself — mean 115.8 documents, p90 260, max 553 — measured p90
3,007 ms); the acceptance read's own worst case, the SAME H132 that produced a 755-document/
10,774 ms call in step 4-4, now caps at 512 documents and reranks in 7,857 ms. (2) the arm now
always computes a capped-scope companion selection from the SAME material, and retrieve()'s
fallback restricts to it instead of the wide pool. Measured, not assumed (the standard
this same finding demanded of step 4-4): replaying the gpu acceptance read's own captures
through the fixed retrieve() with a reranker stub whose rerank() throws on every call
scores allPacked26, anyPacked42, goldSpanInPacket142 — an EXACT match to
the baseline, not merely "at or above" it (fallback-measured.json). A rerank timeout, crash
or failed start now costs only the upside, never the floor. One real fix-of-a-fix along the
way: the restriction's own guard originally skipped a packs-only ask (noDocuments: true —
zero document candidates, exactly the scope both the acceptance harness and a real "Search my
documents" toggle-off use) entirely, leaving it on the unrestricted wide pool; caught by
re-measuring this same figure before writing it, fixed, and pinned by a dedicated test (no
existing property test had noDocuments: true, so none could have caught it).
The embedder/reranker failed-start latch is for a PERMANENT fault only — a transient port-bind
race no longer arms it (arch GPU record §5.5b). Each
sidecar latches a failed start so it doesn't re-await the full health timeout on every call. That
latch is meant for a corrupt/incompatible GGUF; it previously also armed for a transient
port-bind race (the bind retry is bounded to ONE attempt, so a near-simultaneous chat + embedder +
reranker + vision startup can lose the port twice). That silently disabled all imports (the
embedder has no graceful degradation) / all reranking (a silent fall-back to fused order that
even survived suspend()) for the session until lock/unlock. A bind-class start error is now
excluded from the latch (isBindRaceError), so the next embed()/rerank() re-attempts on a
fresh port. Residual: a GENUINE load fault still latches — for the embedder it clears on a
workspace lock/unlock (replace the weight file and retry) and, since #634, when the search model
is downloaded again in the app (the repair "Check all model files" offers) or a completed "Check
all model files" finds its file intact (a file copied back outside the app, a transient cause);
for the reranker it persists for the
session (reranking stays off, retrieval keeps the fused order) by design.
A cancelled job's sidecar start keeps loading (#635, #637). A Stop or cancel during a
sidecar's cold start ends the job at once, but not the start: the search model, the reranker, the
vision model or the translation model goes on loading for the next job, which joins it. A start
that lands with no job waiting is torn down by the idle timer like any idle sidecar: vision and
translation after their 2-minute window (the embedder and the reranker have no idle timer and
stay loaded, as after any question). Until then it holds its memory: up to ~10 GB for the
translation model. A lock or quit cancels the start at once (rag-design.md §12.4 "#635
amendment", architecture.md image-understanding record §6 "#637 amendment").
The FTS5 index duplicates chunk text inside the workspace DB (a self-contained table was
chosen over external-content on chunks' implicit rowid, which VACUUM may renumber). Bounded by
the 1 000-chunk/file cap; encrypted at rest with the same DB file.
Keyword search is embedder-visibility-scoped by design: a document whose vectors were
produced by a different embedder is not keyword-searchable either, until re-indexed — that is
a deliberate honesty rule, not a gap (REINDEX_NEEDED_ANSWER tells the user what to do).
Grounded document and knowledge-pack answers pin a fixed decoding setting on the request
(temperature 0, no seed, a 1024-token cap per pass) instead of the model server's own
defaults — a systematic replay of many recorded real requests found no measurable difference
in correctness, refusals or citations on the requests measured, all of which were recorded
before knowledge-pack tables were delivered to the model. A reply that reaches the cap is not
silently cut: the same continue-generation engine the whole-document path uses (below) picks
it up, capped at 1024 tokens per pass, continued up to twice more, then honestly flagged
truncated if still cut after that. Since #498 that flag no longer blames the context
window: the badge says only "Reply cut off", and a reply the app's own cap ended says so and
offers "ask the model to continue" rather than "raise the context size", which would not help.
Document tasks & summaries
The audit §N.M citations in the skills/extraction residuals below refer to the 2026-07-02 Skills
& Tools audit, folded (with its 20-phase remediation plan) into architecture.md
§39 — read them through that record's §-anchor legend.
Very long documents get a beginning-only summary (the map-call ceiling). The
budgeted map-reduce caps at 12 map calls (≈ a ~50-page document at the default
4096-token context) — Deep map-reduce over a 1000-chunk corpus on a CPU laptop is not a
v1 promise (D25). The summary is flagged truncated and the UI says so honestly; the
whole document remains searchable/answerable in RAG. A smaller contextTokens setting
shrinks the per-call budget and hits the ceiling sooner.
Summary input is the stored chunks, not a re-parse (D25). Adjacent chunks overlap by
~80 tokens, so stitched windows repeat a little text (harmless for summarization).
Over-cap documents are now REJECTED at index time, not silently truncated
(C1/C2/M13 — behavior change). A document that would
exceed MAX_CHUNKS_PER_DOCUMENT (1 000) fails with a friendly "too large to fully index —
split it" message (main.ingest.tooManyChunks) instead of indexing only its first 1 000
chunks. So every indexed document is now the WHOLE document (recorded by the
fully_chunked marker), which is what lets a deep index honestly claim full coverage.
Consequence: a legacy document indexed before this change (which may have been silently
truncated) carries no fully_chunked marker — it is re-indexed before any deep-index /
100 %-coverage claim, and if it is genuinely over-cap that re-index fails closed (the
doc becomes failed/unsearchable and must be split into parts — the cap check runs before
the destructive chunk replacement, so it never half-deletes a previously searchable doc).
A deep index ("ready" summary tree) gives a whole-document summary; without one the
capped map-reduce still applies. When a document has a built tree (tree_status='ready'),
"Summarize" serves the tree root verbatim (full coverage, truncated:false) at no extra
model call. The build is a background, yielding job that cedes the model slot to chat
between nodes; it is auto-offered for documents the capped summary can't fully cover and
otherwise built on request. (#151 KL-1: the coverage-meter UI SHIPPED — CoverageMeter +
TierMenu render on every eligible turn — so the "later phase" caveat that stood here is gone.)
A background deep-index build cedes the slot to chat, but not to other document tasks.
While an auto-started tree build runs (multi-minute on a weak CPU), an interactive chat
answer pauses it and is served within ~one node, then the build resumes. A user-started
Summarize/Translate/Compare, however, queues behind the build until it finishes — the build
yields only to chat. It is the active task, so it shows as "Building a deep index…" and can
be cancelled from the busy banner (which lets the queued task run); a cancelled build is
resumable from the warm cache. An explicit model Stop/switch also aborts it (it re-builds
under the new model). Finer task-vs-build prioritisation is a later phase.
The deep-index summary cache (summary_cache) is bounded by a row-count cap, not kept
forever (backend-audit-2026-06-27 DATA-3/MAINT-3). The cache maps a tree group's content
hash → its computed summary so a rebuild — or a different document with identical boilerplate
— skips the model call. It carries no document_id and deliberately survives node/tree/document
deletion (so a rebuild stays cheap), which means no foreign key ever prunes it. To keep a
long-lived portable drive from growing the table without bound, each tree build opportunistically
evicts the oldest rows past SUMMARY_CACHE_MAX_ROWS (50 000 by default; env
HILBERTRAUM_SUMMARY_CACHE_MAX_ROWS) via evictSummaryCache. It is a cache, so an evicted row
only costs a future re-summarize, never data loss; each pruning writes one content-free local log
line ("Summary cache pruned": rows evicted, rows kept, the session total). v1 had no eviction at all (the
audit's DATA-3) — this bounds it cheaply rather than precisely (eviction runs once per build,
not on a timer).
"List every X" answers are exhaustive over the SECTIONS SCANNED — not guaranteed complete
(H7). When a document has been through the structured-extract
pass (a manual, yielding background task like the deep index), a "list every / how many {X}"
question is answered from precomputed data at zero model calls with per-item provenance and
an honest coverage line ("… sections scanned: N (k could not be read)"). It is not a
guaranteed-complete list: a small model can miss an item, very similar values are merged, an item split across the
~80-token section overlap can double-count, and a section whose reply was unparseable is counted
as "unparsed" (its items may be missing) rather than dropped. Since STR-1 §5.1 (2026-07-20) the
pass grammar-constrains the reply (D55 responseSchema), so unparsed sections should be RARE on
the real runtime — the remaining causes are a thinking model burning the token budget on
reasoning and a reply cut off at the cap, and an explicit "Build deep index" re-run retries them. The "whole document" wording is
shown only when every in-scope document is fully indexed (fully_chunked). An unmapped/ad-hoc
"{X}" (no precomputed type: "list all the abbreviations", "how many pages") is not answered
as a list — it gets an answer from the most relevant passages, led by a short heads-up ("…so it may
miss items") when those passages left part of the documents out (true since #641, 2026-10-11; before
that it got the unrelated generic table). One document that fits the model's window is read whole
instead (#643, next entry), so it gets no heads-up. An explain request is answered the same way even when it
names a typed thing ("Erkläre alle Fristen"). Both are recognised by vocabulary (EN + DE word lists
in router.ts), so an unusual phrasing can still miss. The rule errs towards the written answer: an
explain verb anywhere in the question ("List every clause that describes the deposit") and a list
typed only by "who" / "when" ("Wann muss ich alles bezahlen?") also get it, not the listing.
Since #644 (2026-10-12) "all / every / each" (alle / jede / sämtliche) asks for the list only at the
start of a request ("Alle Fristen?", "Kannst du mir alle Fristen nennen?"). A yes/no question that
carries one ("Gilt die Frist für alle Mieter?", "Does the contract list all the deadlines?") gets an
ordinary answer with no heads-up. One inside another question ("Welche Frist gilt für alle
Mieter?") gets the labelled answer. These shapes are also recognised by word lists, so a few still
miss:
Still listed: a claim without a verb ("Alle Zahlungen pünktlich eingegangen?") and "Can we have all
the payments refunded?". ("Zählen alle Zahlungen zur Miete?" gets an answer since #649.)
The written answer instead of the list: a request whose "all" comes after another phrase ("Kannst
du mir ab dem 1. Mai alle Zahlungen zeigen?"), one that opens with a verb the list lacks, and one on
a new line after other text.
Since #649 a "how much" question about one amount ("How much is the monthly fee?") gets an ordinary
answer. A question about a list the document holds ("Welche Fristen stehen auf der Liste?") and a
"belongs to" question ("Welche Kosten zählen zu den Nebenkosten?", "Which fees count as operating
costs?") get an ordinary answer too. A sum ("How much did I pay in fees?", "Wie hoch ist die Summe
aller Zahlungen?") is read whole when the chat has one document short enough for that. Otherwise it
gets every amount, led by a note that the list cannot add them up. Also recognised by word lists:
A total asked with no sum word and no pay verb in the past ("What did I pay in fees?", "How much
do I pay per month?") gets an ordinary answer.
A question about a total the document states ("What is the total amount due on the invoice?") is
treated as a sum. Over a longer document with a deep index it gets every amount, not the total.
"Wie viel Zahlungen gibt es?" (a count) gets an ordinary answer.
A list noun such as "the full list" or "price list", or one that comes before the question word,
still lists ("In der Liste fehlt eine Frist, welche?").
A listing shows one kind of item: "Liste alle Termine und Beträge auf" lists the dates.
v1 has no live full-scan for unmapped
types and does not auto-run the extract pass at import (it is started on request) — both are later
phases. The extract pass, like the deep index, requires a fully-chunked (re-indexed if legacy) doc.
The listing cannot categorize or sum — and since issue #54 (2026-07-17) it says so; since #80
(2026-08-09) it also offers the fix. An aggregation-shaped ask ("categorize the transactions,
sum per category") deliberately routes here (never a lossy top-k sum, #37), but the engine only
groups values with counts; the answer used to present the raw frequency list with no hint that it
wasn't what was asked. A non-empty listing for such an ask now LEADS with an honest shape hint,
plus — for amount asks — a one-click "Run "Bank Statement Analysis" for this question" offer on
the answer (that skill's category engine is the one path that groups transactions and sums each
category exactly; clicking re-answers with it — nothing runs unclicked). Non-amount aggregation
asks, and low-confidence fallbacks, may instead spend one bounded (≤ 4 s), grammar-constrained
local classification call inside the already-held answer slot to pick the suggested skill — its
output can only name an enabled skill (whose engine would actually engage, #133) or "none", and it
never changes the answer text. Plain "list / how many" asks are unchanged (0 extra calls). A
generic no-skill categorized-sums path (tabular routing over a generic row extractor) remains
deferred (architecture.md result-tables record §5/§6).
A total over one short document is the AI model's own arithmetic (#649, 2026-10-12). Since
#649 a sum or categorize ask over ONE document that fits the model's window is read whole instead of
listed, with or without a deep index. The answer leads with a heads-up that the model works out totals
itself. The heads-up is needed: with the whole one-page statement in its prompt,
qwen3-4b-instruct-q4 summed its four fees wrong twice, at 5,45 and 8,35 EUR for 13,85; a lease's
three monthly amounts it added up right. Nothing checks the total. For a bank statement, the
bank-statement skill adds up exactly. A chat with several documents, or a longer document, keeps the
listing above.
Only a single document is read whole, and only when it fits the model's window (#643 / #642,
2026-10-12; rag-design §14.5). A document question over ONE fully indexed document that fits the
launched context window (about 3 pages at the 4B's 4,096 tokens, about 7 at 8,192) hands the model
the whole document in order instead of the best-matching passages. Everything else is still answered
from the most relevant passages: a chat with several documents (there is no multi-document whole
read), a chat with knowledge packs selected (the whole read never searches a pack), a short question
about the last answer ("Sure?"; it reads the documents with the bare message as the query, so with no
matching passage it gets the fixed "I couldn't find this in your documents" reply; other small talk gets a short
reply that reads no document, #963), a
legacy document indexed before fully_chunked existed (re-index it), and a document longer than the
window. A summary question over such a longer document uses its deep index when one is built (#642);
without one it is still answered from the most relevant passages, with no hint to build the index,
and a summary question over several documents, or in a chat with knowledge packs, never uses the deep
index (since #736 such an answer gets the same "may miss items" heads-up as without a deep index: when
the question asks about each or all of something and the passages left part of the documents out).
Raising the context size
raises what counts as "fits": on a CPU a 32k window can mean a ~20,000-token prompt, and minutes of
prefill, for every question about a 30-page document. An off-topic question about a document read
whole now costs a model call (the model says the document does not cover it) where the passage search
could answer "not found" without one. Answers given before #643 keep their old source display.
Small talk in a chat about documents gets a short reply that reads no document (#963, follow-ups
wave 5, owner call G-1; rag-design.md §19). A thank-you, a greeting, a goodbye or
"How are you?" gets one short reply from the model, which sees only the message: no document, no
earlier turn, no skill instructions and no knowledge pack. The reply has no sources, no coverage line
and no skill mark. What counts is a short list of questions to the assistant ("How are you?",
«Wie geht's?», "What can you do?"), of whole thanks and greeting formulas («Passt», "Muchas gracias") and
of thanks, greeting, goodbye and praise words in the ten interface languages, so four things follow. A
message with a question mark anywhere in it, in any script, is a question about the last answer and is
answered from the documents (with no matching passage, by the fixed "I couldn't find this in your documents" reply, W-6): "Sure?", «Alles?», «Bitte?» for "pardon?", «Passt?», «¿Vale?», "Sure? Thanks";
only the questions to the assistant keep the short reply with theirs. A message of acknowledgement words
alone ("ok", "sure", "all", «alles bitte», «klar», «vale», «tamam», «ладно») can answer the assistant's own
question or offer ("Shall I list the other deadlines?"), so it is answered from the documents with the
conversation, as before; with a thanks or a greeting in it ("Ok, thanks") it gets the short reply. Praise
counts as a thanks, so an offer accepted with "Great" or «Super» alone gets the short reply, not the list:
ask for it in words, or with "ok". A thank-you that names what it thanks for also gets the short reply, in the
ten languages (#983, owner call G-8): "Thanks for the summary", "Thanks for the help!", "Great job!", «Danke für die
Hilfe», «Merci pour le résumé», «Özet için teşekkürler». The shape is closed: a thanks, "for", an optional "all", up to two determiners ("the", "your", «il tuo»), an
optional praise adjective ("Thanks for the great summary") and one noun for what the assistant gave (summary,
minutes, report, list, answer, help, info, work and the like), at most a closing word; Turkish also takes the thanks
last or first («Özet için teşekkürler», «Teşekkürler, özet için»). Or an intensifier ("very", «sehr», «muy»), a praise
adjective and that noun, written with only spaces between them ("Great summary", «Gute Arbeit», "Very good job"),
with a thanks after it at most. A comma, a dash or a full stop between the praise and the noun makes it an
acceptance followed by a request, so "Great, list", «Gut, Liste», «Отлично, таблицу» and «Добре, таблицю» read the
documents. Praise adverbs («отлично», «świetnie», «чудово») and acceptance words («добре», «gut», «iyi», Polish «dobra», which is usually "OK") are no praise
adjectives. Any other word keeps the request ("Thanks, now write the minutes", "Thanks for the summary of the
risks"), and so does a noun first ("Summary, thanks!"). A thank-you longer
than that is still taken for a question about the documents (below). Review evidence (#976): the action
shows only under an answer with sources or a coverage line, or one that already has a review, so it is not
offered under this reply, the fixed no-context reply, a routing answer or a refusal. The deterministic "list
every …" answer has neither, and does not offer it either.
A kind:tool skill answers from its whole-document tools — or refuses, never partially
(full-doc-skills, D44–D49; architecture.md "Skills — design record" §19). This is the third
coverage state, distinct from the two above. When a tool skill (bank-statement, invoice) is the
resolved turn skill and the question is analysis-shaped over a single, fully-chunked in-scope
document, the chat turn does not take the top-k relevance path: it auto-runs the skill's
read-only whole-document tools (export stays confirm-gated), computes the figures
deterministically from the extracted table (zero model calls), and stamps a real extract coverage
whose "whole document" wording is gated on fully_chunked (D48 — coverage is now persisted per
message, not hardcoded relevance). If any in-scope doc is not fully chunked the turn is
refused with a fixed message pointing at Documents → Re-index — no partial answer, no model call
(D45) — rather than silently answering from a few passages (for accounting, a partial read is a wrong
total). A4 (SKA-7 structural, audit §3.2/§8.2) finished the inversion for tool skills: with the
bank/invoice skill active over a single fully-chunked document that plausibly is the skill's
class (it matches the skill's manifest doc signals, OR a persisted extraction already exists for it),
every non-small-talk question now reaches the handler — the phrasing (routeMatch) veto is retired,
so an on-topic money question that misses the 45-term vocabulary is answered from the verified
extract (grounded-data, which post-W6 honestly declines an off-data question with "the data does not
carry that") instead of silently degrading to raw top-k chunks + model arithmetic (the pre-W3 incident
class, on the two highest-stakes skills). A document matching no signal and never extracted keeps the
ordinary relevance path (the W2 plausibility posture, inverted — a contract with the bank skill sticky is
never force-extracted on "who signed this?"); clear small talk ("danke") opts out too (no extraction,
no narration). An intent-shaped question over a multi-document scope is narrowed or routed
(W2, audit §2.1, recorded below). document-redaction is an action skill: it registers a
routing handler (not an exhaustive one — D49a, 2026-06-22), so a redaction-shaped request
returns a short answer pointing at its run button (no content read, no tool run, no coverage
badge) instead of a top-k Q&A that lectured and falsely claimed a relevance-limited reading; the
write tool stays user-initiated and confirm-gated. The Tier-1 instruction skills
(meeting-protocol, contract-brief, share-safe-review, deadline-obligation-finder) register
grounded-whole-doc handlers (skill-whole-doc engine, Wave 2, §20): an analysis-shaped request
over a single in-scope, fully-chunked document streams a model answer over the whole document
(read in order, not top-k) with the SKILL.md format applied, stamping honest capped coverage. A
document larger than the context budget that has a ready deep index is answered by a skill-fenced
map-reduce over its tree instead of truncating (tree badge — Follow-up A, §20); without a ready
tree it is now covered whole by an on-the-fly map-reduce over its raw chunks
(capped/untruncated badge, "covers the whole document"), which closes the
"gap band" where a document too large for a single read but too small to auto-build a tree was read from
the beginning only. New residuals: (a) a very large document is covered whole up to a raised ceiling —
a window count between SUMMARY_MAP_CALL_CEILING (12 windows, 50
pages) and SUMMARY_MAP_CALL_HARD_CEILING (24 windows, 100 pages) is no longer dropped: every mapped
window's notes are condensed down through bounded fenced intermediate reduces (a hierarchical fold, cap
MAX_FOLD_DEPTH) until they fit one final reduce, so the whole document is covered (truncated:false).
Only beyond the hard ceiling (100 pages) does the tail stay honestly beginning-only (truncated:true;
since #996 the answer's first line says so too)
— that is deep-index tree territory (the tree auto-builds at ~this size and is the designed rescue; the
fold is a bounded query-time lever, deliberately not unbounded — the dominant cost is one map call per
window on CPU, covered by the progress notice in (b)); (b) a mid-size analysis
now costs 2–12 model calls (map windows + reduce) of extra latency before the first streamed token —
that gap carries the ephemeral 'analysis' progress notice ("Reading the
whole document…"), fired in the shared map-reduce core only when a real map loop runs (windows.length > 1) and cleared on the first reduce token, so it no longer reads as a hang; (c) on a small (4 k) window a
very long deliverable used to be output-cut:
the reduce output reserve is adaptive (computeReduceBudget) — it aims
for ANALYSIS_RESPONSE_RESERVE_TOKENS (3072) so a brief completes in full on a ≥ ~8 k window, and on a
4 k window it yields the reserve toward CHAT_RESPONSE_RESERVE_TOKENS (never below) so whole-document
coverage is preserved and the deliverable shrinks instead (notes-first — the gap-band closure
survives at the default 4 k). That output cut is closed by
continue-generation: when the reduce stream ends finishReason === 'length' (cut at the ceiling, not a
user Stop), the shared core re-prompts to FINISH the deliverable — re-sending the same fence + notes +
question plus a resume anchor (the last ~200 chars, seam de-duplicated) — across at most
MAX_REDUCE_CONTINUATIONS (2) extra passes, each output cap sized against the actual assembled prompt so
prompt + output ≤ n_ctx still holds (no HTTP 400). Only a document whose notes cannot fit alongside even
the floor output is notes-truncated (honestly badged coverage.truncated — the INPUT-coverage flag). The
continuation engine was extended to the single-turn grounded path: any
grounded answer cut at the context ceiling — relevance top-k, the small-doc fits-budget read, or the
whole-doc capped read — is now finished the same way (re-sending the whole grounded prompt + a resume
anchor), so a mid-word grounded reply no longer persists as if complete. New residual: a deliverable
long enough to STILL be cut after the 2-continuation cap keeps an honest OUTPUT-truncated badge
(Message.truncated, "Reply cut off") — this is distinct from
coverage.truncated and never conflated with it (the whole document can be covered while the deliverable is
output-cut). Since #996 the same badge also marks an answer that was cut, continued, and then ended
cleanly in the middle of a sentence: a 4B Contract Brief stopped at "… unless the lease provides otherwise
or" after a continuation of about 700 tokens, and was stored as complete. Its tooltip offers the remedy of the
pass that was cut. Only the last line is judged, against the answer's own style: a last line that ends in a
word reads as cut only when most of the answer's earlier long lines end with a full stop or another
terminator, and one that ends with a comma, a colon or an open bracket always does (a dash or a slash is
judged like a word, since it can end a URL or a "not stated" value such as "Renewal option: —"). So a table row, a
heading, a code block, a short list item, a signature, a URL or a list written without full stops reads as
complete; over 413 stored real answers the check flagged 4, all genuinely cut. Some cuts keep no badge (the
accepted misses): a cut right after an abbreviation such as "e.g.", a cut inside a table row, a short last
item or line, and a cut in an answer written without full stops. An answer whose first pass ended cleanly is
never judged this way, so a model that stops
mid-sentence on its own still carries no badge. Since #994 a whole-document pass (the first or a
continuation) that starts repeating itself is stopped there, cut back to before the repeats and not
continued; the answer carries the same badge (cause 'repeat', "The model started repeating itself …"). Guarantee unchanged: prompt + output ≤ n_ctx at every
context size (no HTTP 400 "exceeds context size").
what-changed registers a grounded-whole-doc-compare handler
(Follow-up B): a compare-shaped request over exactly two in-scope docs reads BOTH versions whole
(budget split size-aware across them, capped coverage — truncated when either overflowed) and
presents them as labelled blocks, instead of top-k. A tree-backed compare (the §20 map-reduce applied
per oversized doc inside the compare) remains a documented follow-up — today an oversized compared
doc is read capped, not tree-reduced.
W1 (audit §2.2) made the beginning-read honest AND safe at the default 4096 context. The grounded
prompt now carries an explicit partial-document notice — the model is told "sections 1–N of M
provided" and FORBIDDEN to assert an absence ("no decisions found") beyond them — so the answer text
can no longer claim completeness (the compare fallback prints the notice per truncated half). The
whole-doc AND compare budgets apply the same 1.5 German-subword safety divisor the relevance path
uses, so a budget-filling German (subword-dense) whole-doc turn no longer risks the raw
HTTP 400 exceed_context_size_error. Consecutive same-segment chunks are de-overlapped (the known
~80-token chunk overlap stripped, metadata-gated on page/section) so the read stops wasting ~16 % of
the scarce budget on duplicated text — and the compare-split sizing measures the same de-overlapped
totals. The tree map-reduce, which formerly "lied at the margin" (hard-truncated its notes while
stamping truncated:false), now flips to the honest truncated/"covers the beginning" badge and a
softened reduce prompt when it hits the 12-call map ceiling (SUMMARY_MAP_CALL_CEILING) or clamps
its joined notes to the reduce budget. The softened prompt asks the model to say that it covers only the
beginning, and a 4B model did so in 0 of 8 such answers, so since #996 the answer leads with the app's own
line instead (design-guidelines §11.25); the answer's copy and its export carry it.
Open follow-up (deferred by W1): auto-building (or one-click
offering) the deep index when a whole-doc turn truncates (the routing of lookup-shaped questions to top-k
on truncation was since done by A3 — the needle-vs-deliverable downgrade below).
W2 (audit §2.1/§3.4/§4.5) killed the silent doc-count fallthrough and added a document-plausibility
gate — all deterministic, zero new model calls. Before W2, when a tool/whole-doc skill was the turn
skill but the in-scope document count was wrong (a multi-doc scope, or the default whole-library
scope), applies() was false and the turn fell through silently to ~2 top-k passages dressed up as
a whole-document read. Now, when the question is intent-shaped (a new doc-count-agnostic
SkillAnalysisHandler.intends()) but applies() fails only on count, the chat path (registerRagIpc,
before the existing dispatch) either (a) narrows to the ONE in-scope document that matches the
skill's own manifest doc signals (filenamePatterns/mimeTypes, via the shared
matchesSkillDocSignals in selector.ts) — proceeding against it with an honest scope notice
prepended to the answer (skills.analysis.scopeNarrowed; the streamed grounded path carries it via
a new generateGroundedAnsweranswerPrefix option, also threaded through the tree-rescue path) —
or (b) routes with a deterministic answer: skills.analysis.selectOne ("pick one document") when
0/≥2 docs match, and skills.analysis.selectTwo ("select exactly two") for what-changed at ≠2
docs (its SKILL.md no longer asks the model to police a scope it cannot see — §3.4). A 0-doc scope
is left on the ordinary relevance path (its own "no documents" honesty). The plausibility gate
(§4.5): in bank/invoice run(), a zero-row extraction on a document that matches none of the
skill's declared signals returns a fallThrough result, so the turn takes the ordinary grounded path
(the LLM answers the actual question) instead of the misleading "I read the whole statement but couldn't
find any transactions" template — the exact contract-with-bank-skill-sticky failure. Zero rows on a doc
that does look like a statement/invoice keeps the honest empty answer; and — the conservative D56
posture — a skill that declares no signals (or whose row can't be read) does not fall through
(it keeps the empty answer, so a real statement whose rows merely failed to parse is never re-routed to
a top-k model). Residual (documented, A3 territory): the financial skills declare a broad
application/pdf MIME, so the discriminating signal in practice is the filename pattern — a
contract PDF (matching the MIME) with the bank skill sticky still keeps the empty template rather than
falling through; the fix stands for non-PDF/CSV docs and for the multi-doc narrow/route paths.
W3 (audit §3.1/§8.1) added the missing THIRD answer mode — an LLM answer over the deterministically
extracted + validated invoice, with figures quoted verbatim. Before W3 an invoice question hit either a
fixed template (buildInvoiceAnswer, question-agnostic — "who is the vendor?", "wann ist die Rechnung
fällig?", "warum stimmen die Summen nicht?" and a repeat follow-up all got the byte-identical totals
template) or the raw-chunk relevance path; the extracted rows never reached the model. Now the invoice
handler routes by ANSWER SHAPE (not document access — every shape reads the SAME extracted invoice): a
format ask (detectFormat) serializes JSON/CSV/XML (unchanged); a summary/reconcile/list shape
(a narrow, word-anchored stem list — summar/überblick/zusammenfass/reconcil/aufstellung/list the items/positionen auflisten/\bstimm(en|t)\b, with a warum/wieso/why explanatory guard so
"warum stimmen die Summen nicht?" is NOT the template) keeps the deterministic template; everything
else that passed applies() streams a model answer over the serialized verified object (a new handler
outcome { mode:'grounded-data', dataBlock, postscript }) via a new generateGroundedDataAnswer.
buildGroundedDataPrompt hands the model buildInvoiceJson + the reconciliation results + a provenance
note under FIXED rules (answer ONLY from the data, quote figures character-for-character, NO
arithmetic/derived numbers, say plainly when the data lacks the fact, answer in the user's language) — the
LLM never computes a figure, it narrates parsed data. Under every grounded-data answer the app appends
a deterministic totals postscript (net/tax/gross as parsed, verbatim) so a model misquote is
immediately contradicted; the R5 date caveat also rides that postscript (a due-date question now
routes to grounded-data, so its honesty is preserved). W6 (audit §3.1, SKA-5) then threaded the U1
droppedRowCount into this mode: the invoice data block gains a MISSING-lines note + a softened
(non-"whole document") provenance line and the postscript appends the countPartial hedge whenever a
money-bearing line was dropped (an invoice has no balance proof, so any drop hedges) — closing the gap
where a dropped>0 invoice answered "how many line items?" over the mode as if the list were complete.
W6 (SKA-21) also fixed the totals/echo currency: a mixed-currency invoice with no header currency now
stamps no code (via invoiceTotalsCurrency/amountText) instead of misleadingly using lineItems[0]'s,
and no dangling space when the currency is absent. The grounded-data turn uses its OWN system prompt
(GROUNDED_DATA_SYSTEM_PROMPT — no [Sn] excerpt-citation rule, since it carries a data object, not
numbered excerpts) and REPLAYS conversation history, so follow-ups no longer re-trigger the byte-identical
template. buildInvoiceAnswer also gained a Details block (vendor / invoice number / invoice + due
date), so those header fields surface even on the template path (the "who is the vendor" gap dies on both
paths). Citations + honest extract coverage pass straight through (source of truth = the deterministic
extractor); the data block caps line items at ~150 rows (totals + header always kept). W4 (audit
§3.1 bank half / §3.3 / §3.6-low) ported the same third mode to the BANK handler and closed the
self-referential escape-hatch copy. The bank run() now routes by the same ANSWER SHAPE: a format
ask (detectFormat) serializes the statement inline — new buildStatementJson (transactions +
cashflow summary + opening/closing balances) or the existing transactionsToCsv (rows only) — closing
the §3.3 gap that the bank template pointed at a CSV export the handler could never produce; a
summary / reconcile / total / balance / category / list shape (a broader stem list than invoice —
for a statement the totals ARE the D56-gated headline, so total/summe/saldo/kontostand/net change/cashflow stay on the completeness-gated template, plus \bstimm(en|t)\b and the
warum/wieso/why explanatory guard) keeps the deterministic template; everything else streams a
model answer over buildStatementDataBlock (the JSON + the balance-reconciliation + the D56
completeness verdict + a deterministic per-category grouping + provenance, capped ~150 rows) with a
deterministic in/out/net postscript (buildCashflowPostscript — empty on a mixed-currency statement,
since there is no single meaningful total; the R5 date caveat rides it too). W6 (audit §3.1, SKA-4/SKA-5)
then made this postscript honour the D56 gate the template already ran: the in/out/net echo prints only on
complete (proven-whole) or unverified (with the unverifiedCaveat sum-of-rows-read line appended), and
is suppressed on contradicted (mirroring the template's incompleteNoTotal refusal — no app-authored
total under the model answer on a statement the balances refute). The droppedRowCount hedge also rides,
but D56 outranks it (mirroring U1 / commit 42a4eb9): a complete balance proof means the dropped line
did not move the balance, so no hedge fires; it fires only on a non-complete status, and the data block's
MISSING-lines note + softened provenance follow the same gate. Its label was also corrected — the bank
in/out/net are computed sums (summarizeCashflow), so the echo now says "Totals computed from the
parsed transactions" rather than the old "verbatim from the document" (accurate only for the invoice echo,
whose net/tax/gross are printed totals — audit §4.5). The self-referential
transactionsMore copy now names the real affordances (the run-bar Export to CSV button for a
saved file + "ask for it as CSV or JSON here in chat"), and the inline CSV intros (bank + invoice,
§3.6-low) state honestly that CSV carries the rows/line-items only while the summary/balances (bank) or
header/totals (invoice) ride in JSON/XML. Because a non-summary follow-up ("warum stimmen die Summen
nicht?") now routes to grounded-data (the template can only PRINT figures, never EXPLAIN), a repeat
intercept no longer re-serves the byte-identical template — pinned by a regression test on both handlers.
The bank port added no extractor-version bump (the serializers are read-side; extraction output is
byte-identical). Residual: bank has no statement XML serializer (JSON/CSV only, per the plan), so
an "as xml" ask falls through to grounded-data rather than an inline XML block.
W7 (audit §3.2/§3.3/§3.4) tuned the answer-shape routing (vocabulary + classifiers only, no
extractor bump): (a) SKA-9 German separable verb forms — "Fasse … zusammen" / "Liste … auf" — now
reach the D56-gated template via word-anchored two-particle regexes on both handlers' isSummaryShaped
(the joined zusammenfass/auflisten stems missed them); the preposition "auf" ("Liste die Buchungen auf
dem Konto") over-fires to the template — the safe deterministic side, accepted. (b) SKA-10 a
WHY/how-come format question ("Warum fehlt im JSON die MwSt?") is now guarded by EXPLANATORY_REbeforedetectFormat, so it reaches grounded-data (which can explain) instead of re-serving the
byte-identical serializer dump (the repeat-loop class W3/W4 killed on the summary path). (c) SKA-20
the spend on/spending on stems were dropped from CATEGORY_KEYWORDS: "how much did I spend on
groceries?" (the flagship grounded-data example cited across the W3/W4 record, the in-code comment, and a
test) now routes to grounded-data (the per-category grouping still rides the block, so it stays
answerable) instead of the category template — removing the tense-flip where the absent spent on reached
grounded-data while spend on reached the template. The explicit "break down by category" ask keeps the
template (categor/breakdown/kategor/aufschlüssel). (d) SKA-7 (vocabulary half) added route-only
German money terms to the bank vocabulary (wie viel, wie viele, zahlung-stem, bezahlt, ausgegeben,
payment) and fällig-stem/due to invoice, so an on-topic money/due question under an already-active
tool skill reaches the handler instead of falling to raw top-k (§8.2 — route-only never touches the
suggestion offer). The STRUCTURAL half of SKA-7 was then closed in A4 (the tool-skill gate inversion
above): with the skill active over a plausibly-in-class single fully-chunked doc, a phrasing miss no
longer falls to top-k — it reaches the handler (grounded-data over the verified extract), so the widened
vocabulary is now belt-and-suspenders rather than the sole guard.
U1 (audit §2.3 / ux-10 / ux-11 / §3.6) made the completeness claim honest and stopped silent row drops
from masquerading as exhaustive reads. The bank + invoice extractors now record an additive
dropped_row_count per extraction (bank_statements/invoices, nullable — pre-U1 rows read NULL and the
answer simply omits the gate) — how many money-bearing lines the parser rejected (a currency-less /
empty-description / fused-amount / ambiguous-balance-as-amount row; a money-shaped token via the shared
hasMoneyToken, so a bare reference integer never counts). A leading date-SHAPE is required for a bank
line to count (LEADING_DATE_SHAPE_RE — the SHAPE, not a successful parse, so a mis-read 31.02.2026 /
no-anchor 03.05.26 booking row still counts), so a memo / FX-reference continuation line (the geometry
Valuta second baseline, whose DESCRIPTION leads) and a money-less header are excluded — they carry figures
but were never transactions, and counting them would falsely gate a correctly-read statement. When > 0
the deterministic answer replaces the "I read the whole statement." / "I read the whole invoice."
headline with an honest "Transactions read: N. Lines with a figure I couldn't parse into a
transaction: M …" (countPartial, the invoice's "Line items read"; EN+DE du-form) —
except when the D56 balance PROOF holds (status === 'complete': printed opening + Σ == closing ties
out over the kept rows, so a dropped line provably did not move the balance and the read IS whole) — the
proof outranks the parse-gap hedge and the plain whole-statement count stands. A D56-contradicted
statement uses a countContradicted headline instead of claiming "the whole statement" over a body that
refuses a total — killing the self-contradicting count line (both the complete- and contradicted-status
interactions were caught by U1's adversarial diff review). The currency-adjacent bare-integer read
(R1's totalsMoney fallback, now the shared lastCurrencyAdjacentInteger) is extended to bank balance
lines (lastMoneyOnLine), so a round Opening balance 914 $ feeds the §3.5/D56 completeness gate instead
of silently losing it. Both extractor versions → 8. The "Every match found …" structured-extract
coverage badge is softened to "Read across …" (ux-10 — it overclaimed exhaustive extraction; a small
model / odd layout can miss a match), and the empty-extraction copy no longer dead-ends — it blames the
reader not the document and names the next step (OCR a scan; else the layout may not be machine-readable).
U1 originally gated only the deterministic template headline; W6 (audit §3.1, SKA-5) composed the same
droppedRowCount honesty into the grounded-data mode (data-block MISSING-lines note + postscript hedge,
both domains), so the count/list questions the third mode owns no longer silently revert U1 — the bank side
honouring the D56-outranks rule (a complete proof suppresses the hedge). See the W4 bullet above.
Finally, every shipped SKILL.md body is reordered so its honesty/safety rules LEAD the first content
paragraph (they used to trail, so the budget-driven fence trim — which keeps leading paragraphs —
silently decapitated them, §3.6) — U7 (SKA-15) then closed the residual: the U1 layout still put the
rules in paragraph[1] while the builder's guaranteed minimum is paragraph[0] only, so a tight budget
shipped an intro promising rules with none delivered; heading + intro + bullets are now ONE paragraph and
the parity test trims the REAL bodies through buildSkillFence at a rules-only budget — and the
buildSkillFencetrimmed/omitted flags are now LOGGED
(ids/counts only, logSkillFenceReduction) at every call site instead of discarded, so a decapitated-rule
turn is diagnosable. Residuals (documented):droppedRowCount uses the parser's own MONEY_RE
definition of a figure, so a round-integer-only line with no decimal and no currency marker (a bare
"Office supplies 500") is still not counted — it is genuinely indistinguishable from a quantity/reference;
and the fence trim/omit surfaces only in the log, not yet as a coverage-meter badge (the renderer /
CoverageInfo surface is outside U1's file scope — a follow-up).
A3 (audit §6.3/§8.2) made the whole-document engine manifest-declared and INVERTED its gate, so it is
no longer chosen by per-skill phrasing. Before A3, whether a skill read the whole document was decided
by hardcoded app handlers keyed on install ids and per-skill, per-language keyword arrays — so every
phrasing gap silently degraded a whole-document ask to top-k-with-fence (the recurring incident class),
and any user-imported instruction skill got top-k only, never the whole-doc engine (§6.3 "skills are
portable in name only"). A3 adds an additive manifest field analysis: whole-doc | compare | none
(shared/skill-manifest.ts, default none, lenient) that an instruction skill of any source declares;
the five bundled instruction skills declare it in SKILL.md (a consistency test pins each declaration to
its registered handler's mode), and a user-imported instruction skill reaches the SAME engine via
manifestAnalysisHandler. Tool registration stays app-only — this is an engine choice, not a
capability (SEC-1 unchanged; a user kind:'tool' skill still runs no tool, and the share-safe PII
pre-scan stays app-keyed). The gate is inverted (registerRagIpc + analysis/whole-doc-skills.ts):
with an analysis-mode skill active over a matching fully-chunked scope the whole-doc (or, at exactly
two docs, compare) engine is the DEFAULT; keywords now play only two skill-agnostic roles —
(a)isSmallTalkopts out clear chatter (a greeting/thanks/assistant-meta keeps the relevance
path), and (b)isNeedleShaped sends a targeted single-fact lookup to top-k when the whole-doc
read would truncate (a needle past the truncation cut would be missed — W1's exact budget calculus is the
input); a deliverable ask (summary/minutes/compare/…) never downgrades.
(#981, follow-ups wave 6, owner call G-9) The lookup list is substrings ("how much", "when is", "when does",
"where is", «wann ist», «wann muss», «was ist der/die/das», …) plus word-anchored forms for the questions it missed:
"when must/should/was/can/could/shall", "who is/was the", «wann müssen/sollen/soll/war/wurde/kann/können/endet/beginnt/läuft»
and «wer ist/war der/die/das». "When must they give notice?" and «Wann endet der Vertrag?» are lookups now, the same in
both languages. The «who»/«wer» forms are definite singular on purpose, and the «when»/«wann» forms name a verb:
"Who are the parties?", "Who is responsible for the budget?", "When are the payments due?" and «Wann sind die Zahlungen fällig?»
still get the whole read (slower, never wrong). A word-anchored veto turns such a
question into a list when it says "each", "every", "which", «jede[nmrs]», «welche[nmrs]», «alle[nmrs]» or a bare "all" ("When must each
obligation be fulfilled?", "When must all invoices be paid?", "When must which documents be submitted?"). The veto reads only
a question that is a lookup through one of the new forms. A question that one of the old lookup shapes already matches
("how much", "when is", "when does", «wann ist», «wo steht», «gibt es», …) is a lookup as on master, whatever else it says: "When is
each payment due?", «Wann ist jede Zahlung fällig?», "What is the clause which limits liability?", "First of all, when is the
deadline?" and "Does the document say anything at all about pets?" are answered from a few passages, as before #981, never
turned into the whole report (monotone against master; a test holds master's verdicts as literals). Two exceptions keep even a
new-form lookup a lookup: a frequency ("When must I pay every 3 months?", "every other Friday", «Wann sollen wir jeden
Werktag zahlen?», «jedes Wochenende»: the quantifier, at most a number or a short modifier ("other", "calendar", «weitere»,
«zweite»), then a whole time word, a weekday, or, after «jede[nmrs]» only, a German word ending in -tag, -woche, -monat,
-quartal, -jahr, -stunde, -nacht, -abend, -morgen; "each stage" and "every outage" are no frequency, and neither is "each
employee time sheet") and a relative or indirect
"which" / «welche» right after a comma. The only veto that got narrower is "all the", a substring on master: it now needs a
letter-free left edge, so "shall the", "call the", "install the" no longer veto a lookup ("When shall the tenant pay?"), while
"all these" and "all their" still do. The other eight interface languages have no lookup list, so «¿Cuándo hay que avisar?»
still gets the whole read (#809). A lookup answers from the passages the search finds. Across languages the search used to miss
the one that holds the answer: «Wann müssen wir kündigen?» over an English lease found the preamble and Art. 7, not the
notice clause in Art. 34 (two runs, the 4B), and the answer then said the lease does not state when to give notice, while
"When must they give notice?" found Art. 34 and the date. Since #1003 a German question over English documents is
translated for the search (Retrieval quality, above), which finds the answering passage far more often, but not always
among the 2 passages the 4B gets at 4,096 tokens: for «Wann müssen wir kündigen?» the notice clause came 3rd, so the 4B
still answered that the lease does not state it, while at 8,192 tokens it gave the date. An English question over German documents, a question in one of the
other eight languages and a short question with no function word («Miete?») are not: when an answer says something is
not in a document written in another language, ask again in the document's language. #997 (wave 7) made the report and list words words: «liste» is the German noun as a word or the end of a compound
(«Liste», «Listen», «Checkliste»), no longer a piece of "listed", "listener", "blister" or «gelistet»; "review",
"brief", "overall", "gist", "analy", "recap", "the whole", "in short" and «durchgehen» no longer match inside
"preview", «Briefkasten», "registration", "analyst", "recapture", "wholesale", "in shortage" or «durchgehend». Three
phrases are lookups too: "rent review" and, after a determiner ("the", "a", "next", "this", ...), "review date/period/clause/mechanism/notice" (a lease term; "review clause by clause" stays a request), "brief answer/reply/response", and
"overall" before an amount ("overall rent", "overall liability cap", unless "picture/assessment/structure" follows); «Listenform» and "briefing(s)" (also «Vorstandsbriefing») stay report and list words; "minutes" after a short number or "how many" is a
time. Not covered: drafting requests that hold an exception phrase ("Draft a brief reply", "Prepare a rent review report") read as lookup-shaped words, not reports; German «briefen» (a verb, and the plural of «Brief») matches nothing; "When is the debrief?" stays a report as on master; English "listen" is spelled like the German plural «Listen» and still vetoes; the lookup stems
stay substrings ("Somewhen is fine" still reads as a lookup through "when is", and "Nowhere is it stated?" depends on it:
narrowing them would lose a lookup master had); a whole word with another meaning still makes a report ("minutes" not
after those words, "purpose of", "conclusion", «Protokoll» and «Vergleich» compounds, and the bare word «Brief», a letter); "Who's the tenant?" and
"When's the deadline?" are no lookups (no contraction forms).
A4 (audit §3.2/§3.3) tuned this composition (SKA-8/SKA-12/SKA-23):(SKA-8) the intends() predicate — the W2 count-mismatch routing gate, consulted only at the
wrong doc count — was decoupled from applies() and made vocabulary-shaped (routeMatch) for the
whole-doc/compare handlers too (it had been !isSmallTalk, which made the W2 pre-pass intercept every
non-chatter question at multi-doc scope — a sticky instruction skill over a Library turned "who is Angela
Merkel?" into a "pick one document" dead-end and made the relevance/coverage-extract engines unreachable).
Now, at a wrong doc count, only a vocabulary-shaped question narrows/routes; a general/off-topic one
falls through to the ordinary engines. applies() keeps A3's single-doc inversion (any non-chatter
question over ONE doc still defaults to the engine). A user-imported skill has no routing vocabulary, so it
never W2-routes (falls through) but still gets the single-doc engine.
(SKA-12) the needle downgrade dropped the "no ready tree" conjunct: a needle prefers top-k
whenever the whole read would truncate, tree or no tree — a ~13-call map-reduce over lossy node
summaries is worse than one top-k retrieval for a single-fact lookup (the tree keeps rescuing
deliverables, which never reach the downgrade).
(SKA-23) the needle downgrade is now evaluated before the D45 fully-chunked refusal for
grounded-whole-doc handlers: a downgraded needle takes the relevance path, which makes no whole-document
claim, so D45's premise (a partial whole read passed off as complete) doesn't apply — a needle over a
not-fully-chunked doc is served by top-k, not refused; a deliverable over a not-fully-chunked doc keeps
the whole read and still hits the refusal.
Residuals (documented): the off-topic opt-out is a bounded small-talk detector, so a genuinely
off-topic but non-chatter question (e.g. "what colour is the sky?") over a fully-chunked doc — under an
instruction skill, OR now under a tool skill via the SKA-7 inversion when the doc is plausibly in-class —
spends a whole-document/extract read and answers "not covered" / "the data does not carry that" rather than
degrading to top-k, the accepted cost of recall over precision once the user has explicitly selected the
skill; a row-specific needle past the tool skill's ~150-row data-block cap gets the honest "N omitted"
note rather than the row; both shape classifiers are heuristic keyword lists (deliberately conservative — a
false needle is worse than a false deliverable), so an unusual phrasing of a needle over an over-budget doc
can still take the truncated whole-doc read (honest via W1's in-prompt "beginning only" notice); and the
needle downgrade is applied to the single whole-doc path only (compare keeps its whole-both read).
Since #963 most small talk never reaches the opt-out: it gets the short small-talk reply first (above);
what still reaches it is a short question about the last answer ("Sure?", «Alles?»), which keeps the
passage search.
A bundled whole-document skill's fall-through turn carries only the skill's rules (skills-audit-2026-07-07
SK-3b, decision D-P2a — RESOLVED 2026-11-15 by #632, open-issues wave owner call G-1, for What Changed?;
extended 2026-11-20 by #831, follow-ups wave 4 owner call G-9, to the other four). Each of the five
bundled whole-document skills has an engine that reads whole documents: What Changed? compares exactly
two, and Contract Brief, Meeting Minutes, Share-Safe Review and Deadline & Obligation Finder read exactly
one. A turn the engine doesn't take falls through to the ordinary answer, which reads top-k passages, or
since #643 one document that fits whole. The engine doesn't take small talk, or a scope with another
number of documents, none included (a knowledge-pack-only scope, a document still indexing); at such a
count a request in the skill's routing vocabulary is narrowed to one
matching document or answered with "select exactly two" or "pick one" instead (below), so only the other
questions fall through. A whole-document skill also sends a single-fact question over one document too
long to read whole to the passage search (the needle downgrade above). D-P2a kept the whole skill fence
on such a turn and relied on the honesty rules (What Changed?'s rule 1: ordinary passages with no A/B
labels and no diff ⇒ simply answer the question). Its revisit condition was met: on a 4B model, most
plain questions on such turns got the skill's report format instead of an answer. For What Changed? that
was the compare format ("Wer ist der Mieter?" got an "Executive summary" and the sections after it, in
the real-app run for #582 on 2026-10-07 and again on master when #632 was measured). For the other four
it was their own reports, on 11 of 16 plain questions (5 of 16 on a 9B model); Meeting Minutes wrote
full minutes for "Who attended?". Since #632 and #831 the fence on such a turn carries only the skill's
first paragraph, the heading and the honesty rules, which is also the minimum the fence keeps when the
context is tight (SKA-15); the section format is left out, and the app log records the cap (skill id
and mode, never the body). Since #962 the room the shorter fence frees goes to the document: on a
4,096-token window, such as the 4B model's, a single-fact question over a long document reads two
passages instead of one, and one document short enough to read whole beside the first paragraph is
read whole; a larger window is unchanged. In exchange, on that window a follow-up under Share-Safe
Review or What Changed? can keep none of the earlier conversation (rag-design.md
§15.9). The answer still shows the skill as applied (the per-message glyph), so the
selection isn't silently dropped. Every read the engine takes keeps the whole fence, as before: the
two-document compare (the exact changes, or both documents read whole when one is a full rewrite), and
a whole-document skill's read of its one document, map-reduce included. Small talk over two documents is
the one two-document turn whose fence is the first paragraph. A downgraded single-fact question that the
deterministic listing answers carries no fence at all, as before. A user-imported skill declaring
analysis: compare or analysis: whole-doc keeps its whole fence on such a turn: only a bundled body is
known to lead with its rules (SKA-15), and a user skill has no routing vocabulary, so its real
deliverable requests over several documents fall through too. The rule has no exception for a bundled
skill's deliverable request over several documents that misses its vocabulary ("Summarize these
three", and in the eight interface languages beyond English and German every such request, «Resume
estos contratos»): that answer gets the first paragraph too; a brief built from top-k passages would be weak
anyway. Plain chat with no documents keeps the whole fence on purpose (#830). There the fence is the only
thing that shapes a compare of two pasted versions, and measured on both models with What Changed?
picked, plain questions were not compare-framed (0 of 6) while two pasted versions kept the format (2 of
2). A trim keyed to the compare vocabulary would drop the format for a pasted compare in the eight
interface languages beyond English and German, and since the plain-chat fence sits in the system
message, each switch between a compare and another question would cost a fresh prompt (about 2 s on the
4B and 4.5 s on the 9B to the first token). Measured on a 4B and a 9B model:
architecture.md §44 SK-3b. What counts as a compare question is the skill's routing
vocabulary. Until #582 a
compare request in one language could miss it while its translation matched: "summarize the
differences" fell through while "Fasse die Unterschiede zusammen" got "select exactly two". The
vocabulary now covers the compare and change words in both languages (architecture.md
§18 "#582"). A question with any of them gets "select exactly two" at any count other than two,
including a Library chat with What-changed still selected.
A whole-document read's notes and the question (#939, #952, #953; follow-ups waves 4 and 5). A
document too long to read in one call is read in parts: notes on each part, then the answer from the
notes. The notes are taken for the question, with no skill and under any whole-document skill, bundled
or your own, unless the question asks for the skill's report: a summary, minutes, a brief or a review
keeps the notes for the skill's task, list word or not, so "Summarize all the decisions" is answered
from notes shaped like minutes. A turn the skill's engine passes on to the ordinary answer, such as a
summary asked of What Changed? over one document, takes notes for the question too; a skill with no
analysis engine keeps the notes for its own instructions. The report words are English and German
(and the summarize example chip in every language), so a report request typed in the eight newer
interface languages gets notes for the question as well, and so does an English or German request for
the report in other words: "Is this safe to share?", «Prüfe diesen Vertrag», "Write up the meeting",
«Erstelle eine Niederschrift» or "Go ahead". The skill's instructions still set the report's format.
Measured residuals (rag-design.md §14.10): on a 4B model, items buried in
repetitive text can still be lost ("List all action items" over a transcript where twenty
near-identical commitments surround the three real ones found none of them, with or without the
question in the notes); on a 9B model, a list request over a document whose clauses repeat can fill
the notes with the repeated clause and miss the real items in some runs (Deadline & Obligation Finder's "List every deadline" over a lease: 3 and 0 of 12
in one session, 11 and 11 in a later one on the same prompt); two rewordings of the list instruction made it
worse, so the prompt stays as it is. A 4B model's notes on a long document copy the skill's report format
into every part, and its answers can invent details; a shorter map prompt cut the copying but did
not improve the answers, so that stays too (rag-design.md §14.10.1). Loops (#994,
follow-ups wave 7): an answer that writes the same row or line six times in a row is now stopped at that
line and cut back to its first copy, and it carries the "Reply cut off" badge, whose tooltip says the model
started repeating itself. The answer is not continued after the stop. A map note that loops is stopped and
keeps one copy. Not stopped: the 4B's Meeting Minutes recursion (the minutes written again inside their own
"Formal minutes version", 8 of 11 stored runs): every rule tried for it also stopped answers about several
leases or meetings that reuse their headings, so it still runs until the output cap and the two
continuations end it, as do a recursion whose first line changes and one nested a level deeper each time. Also
not caught; rows that differ only in a number are never treated as a loop,
because an instalment schedule or one clause a lease repeats in many articles looks the same, so the 9B's
runaway list that counts up invented article numbers (up to "Article 278") still runs on until the output
cap and the two continuations end it, and so does a loop of rows that count up a row number; a row
restated three to five times, a block of rows restated three times, near-copies that differ in a word ("the
Second … Tenth Agreement"), two lines that alternate, a row whose counter cell changes and a loop with no
line break are not caught; the live answer shows the loop until the stop and the saved answer replaces it at the
end of the turn; the guard watches whole-document answers only, not an ordinary document answer (no
loop was seen there) (rag-design.md §14.10, §14.10.2). qwen3.5-9b-ud-q4kxl can
still write under a whole-document badge that its complete list covers only "Part 1 of 2", is
"incomplete", or that the text "cuts off" (#995, open): its notes say where each part's window was cut,
and Deadline & Obligation Finder asks for coverage remarks. Two prompt changes (no part numbers; a line
saying a cut note is no gap) were measured and did not stop it (6 of 8 answers still claimed it), so the
prompts stay as they are. And when the
notes had to be cut to fit, a 4B answer can still say something is absent although its prompt forbids that
(since #996 such an answer leads with a line saying that it covers only the beginning of the document).
The answer still says it read the whole document, which is true of what it read, not of what the notes
kept.
Three accepted skill body-vs-runtime residuals (skills-audit-2026-07-07 SK-16 / SK-17 / SK-18 —
INFO, recorded so the next audit doesn't re-litigate; full ledger in architecture.md "Skills — design
record" §44). None is a defect; each is a place where a SKILL.md sentence is broader or narrower than
the exact runtime, and where "fixing" it would cost more than it buys.
SK-16 — validate_statement_balances is a per-row chain, not the whole tie. The tool does a
per-row running-balance chain (tools/bank-statement.ts:815-864); the opening + Σamounts == closing
tie lives in assessCompleteness (:504-531) on the answer layer. The composition satisfies the
bank-statement honesty rule (no verified total without the tie — see the geometry bullet below); the
tool name just covers less than the body sentence implies. Left as-is: the honest posture is a property
of the composed pipeline, not of the single tool.
SK-17 — meeting-protocol runs over imported audio documents, not live dictation. Its "audio
transcript" works via the audio-file import path (AudioParser → document). Live dictation
returns composer text and never becomes a document (registerDictationIpc.ts), so the skill
can't run "over" a dictation — only over the message it produced. Left as-is (a body clause is the cheap
fix); watch beta — add the clause if users hit it.
SK-18 — invoice/bank mimeTypes deliberately omit text/plain. The bodies say "or pasted text",
but pasted text is not a document (no mime signal) and a lone keyword already clears the suggest bar
(score 2), so the omission is consistent, not a bug. Recorded explicitly so nobody "fixes" it into a
precision regression by adding text/plain to the mimeTypes gate.
Bank-statement extraction reads PDF GEOMETRY (Stage 1; architecture.md "Skills — design record"
§21, D50–D58). A columnar PDF statement (date · description · amount, with the year in the page header)
used to arrive as scrambled reading-order text, so almost no transaction survived the line-oriented
parser (the user-reported HVB "zero transactions" failure). The bank-statement skill now re-parses
the PDF in a layout mode that rebuilds visual rows from pdf.js word coordinates and emits clean,
year-resolved DD.MM.YYYY rows — deterministic, offline, zero model calls (parsers/pdf-layout.ts).
Enabled for bank-statement only (D58 — invoice/redaction/preview keep byte-unchanged reading-order
text). Amended by §42 P3: the invoice analysis path is the one exception — it re-extracts once
through layout mode on a glyph-soup (text_quality:'suspect') verdict; the run-bar invoice extract
stays reading-order. parseDate is untouched (the year is resolved during reconstruction, §3.2). A booking-date
column model (detectDatumColumn) keeps a row from being mis-read as a transaction unless its LEAD
date sits in the statement's leftmost, densest date column — so a value-date (Valuta) column printed
on a second baseline, with a foreign-currency reference amount hidden in its description, is no longer
emitted as a spurious row (the Raiffeisen "Mein ELBA" over-extraction the gold set surfaced). A line
matching an opening/closing balance label (incl. Kontostand per/am/zum <date> — all three
prepositions, skills-remediation R2 §5.4) is treated as a summary and never counted as a transaction
even when it carries a booking-column date + figure (it is read only by the completeness gate). Column clustering is still heuristic (statements vary; an unusual
column geometry can mis-read a row), so a completeness gate (D56, refined by D56-R 2026-06-25)
classifies every answer into one of three outcomes. A VERIFIED statement total is presented only
when the printed opening + Σamounts == closing balance ties out (a clean per-row running-balance chain
is necessary but not sufficient) — complete. When the document makes a balance CLAIM the rows refute
— a non-tying printed opening/closing, or any per-row balance mismatch — the skill refuses a total
and downgrades to an honest "couldn't confirm the whole statement" message (EN+DE) — contradicted.
But when the statement prints no opening/closing balance at all and nothing contradicts the read
(e.g. an online "Umsätze" transaction listing), the skill now presents the figures under an explicit
caveat — "a sum of the N rows I read, not a verified statement total" — rather than refusing a
perfectly honest number — unverified. The cardinal property is unchanged: a number a user could
mistake for THE statement total never comes from an incomplete read; a clearly-labelled sum of the rows
shown is not such a number. A bounded transaction listing trails every non-empty answer so the user can
see the rows that were read. (Before D56-R the no-balance case was refused outright — the over-cautious
behaviour the bug report flagged.)
Stage 2 (a grammar-constrained local-LLM fallback on the residual hard subset, D52/D55) is not
built, but is expected to be needed eventually — it lands only if the Stage-1 deterministic
recall on the local-only gold set (D57) proves insufficient. On the current (small) gold set — three
text-layer statements (sanitized HVB excerpt, a full Raiffeisen "Mein ELBA", an HVB "Umsätze" page)
plus one image-only scan — Stage 1 records 0 hallucinated/partial totals and 0 model calls, the
gate presents the correct VERIFIED total on the one statement that prints opening/closing balances; the
two balance-less statements now present unverified labelled sums (under D56-R; before the refinement
they were refused), and the scan degrades safely (0 rows); the live recall/gate numbers are kept in
architecture.md §21, not duplicated here (re-measure locally to refresh them under the refined gate). The corpus is still too narrow to close D52; because real
layouts vary widely (no-printed-balance statements, ruled/borderless tables, scans), deterministic
geometry will likely miss some, so Stage 2 should be treated as a probable future need — broaden
the gold-set corpus across more banks/layouts to confirm and trigger it (it is gated, not abandoned).
Known boundaries (all SAFE — no wrong total is ever shown): (1) [RESOLVED 2026-06-25 for the
<date> <currency> <balance> shape.] A statement that prints a per-row running-balance line shaped
<date> <currency> <balance> (date in the booking column) used to be over-extracted — the balance row
was mis-read as a phantom transaction. The currency-token class now keeps the bare currency code out
of the description, so the phantom row's description is empty and it is dropped, while a genuine row
whose payee wrapped onto a continuation baseline is rescued by multi-baseline row association (the
same HVB "Umsätze" fix that recovers lost payees, strips the per-row EUR, and folds a separate
debit/credit sign cell into the amount). The 2026-06-24 finding still holds — the balance and amount are
right-aligned in one numeric column, so a "money-column model" could not have separated them; the
token-class + association fix did. Residual (safe): a genuine no-payee row whose booking line is
a bare <date> <currency> <amount> with no continuation below is indistinguishable from a phantom and is
also dropped — a recall loss, never a wrong total. (2) An
image-only / "blacked-out" or scanned statement has no text layer, so geometry-aware extraction
recovers nothing and returns the honest empty/downgrade (never a wrong total); reading it is the OCR
path's job, not Stage 1. (3) When a PDF producer renders one amount as two split items (2.000 +
,00), neither fragment parses as money, so the row carries no amount and is dropped — the transaction
silently vanishes (a recall loss). When the statement prints opening/closing, the dropped row breaks the
tie → contradicted → no total; on a balance-LESS statement, D56-R presents an unverified sum
under-counted by the dropped row (honest per its caveat, no longer a refusal). The scoped fix is an
x-adjacency money re-merge (deferred). The same architecture.md §21 entry pins the
two tuning-constant boundaries (a row whose baselines jitter past the 3-pt tolerance loses its amount; a
Datum/Valuta gap under 12 pt merges, allowing a spurious row). (4) [RESOLVED 2026-06-29 follow-up,
FIN-3 — the balance-as-amount harm.] The geometry DATE_TOKEN_RE used to BACKTRACK a bare-thousands
amount (2.500) into a date and DROP it as an out-of-column value-date, so a <date> X 2.500 1.000,00
row reconstructed as …X 1.000,00 and the line parser read the running balance as the movement amount
(a confidently-wrong figure). Requiring a year to be preceded by its own dot makes 2.500 un-date-able, so
it survives into the reconstructed line and the shared MONEY_RE (which reads bare-thousands/apostrophe)
parses it. Residual (safe): the geometry MONEY_TOKEN_RE was deliberately NOT widened to accept
bare-thousands (widening would make the split-amount boundary (3) emit a wrong figure — 2.000+,00 →
amount 2000, cents lost), so a row whose ONLY figure is a no-cents bare-thousands / apostrophe token
carries no money token at the classifier and is dropped — a recall loss, never a wrong figure (it
reconstructs correctly whenever a 2-dp figure also anchors the row, e.g. amount + cents balance).
(5) [skills-audit-2026-07-03 R7, SKA-13 — dot-decimal d.dd amounts.] A yearless d.dd token
(5.04, 1.12 — the CH/UK/US small-amount forms) is BOTH date- and money-shaped; date-first
classification ate it as an out-of-column date, so dot-decimal statements reconstructed with the
running balance as the row's only figure (balance-as-amount) or lost the row. parseTransactionRow
now re-reads such a token as MONEY under four row-context guards (out of the Datum band; after
description text — a dotless VALUTA next to the booking date stays a dropped date; before any
money-class token; and only on rows with no numeric-TEXT token and no comma-decimal money — an
apostrophe/bare-thousands "text" figure or a de-AT comma amount on the row keeps the honest legacy
drop, since reclassifying beside them re-created balance-as-amount in the adversarial R7 review).
Raw-text and continuation rows keep the conservative date-first read (a kept d.dd on a raw line
could re-enter the line parser as a spurious leading date; a continuation must still absorb its
wrapped text). Residuals: a layout printing a dotless yearless Valuta AFTER the description on a
dot-decimal statement is shape-identical to <desc> <amount> <balance> and still mis-reads (every
observed Valuta form prints adjacent to the booking date, with a trailing dot, or with a year); and
the Datum-band bootstrap vote counts ambiguous d.dd tokens as dates, so a page with MORE
date-plausible dot-decimal figures in one band than booking dates could in principle mis-place the
band (pre-existing lens gap; ties break leftmost, which protects every constructed real layout).
The bank/invoice LINE PARSER makes deliberate locale/column assumptions. The deterministic
line parser shared by the bank and invoice tools
(tools/money.ts, distinct from the geometry pass above) carries these accepted behaviors, all pinned by
adversarial whole-string tests:
Date locale is INFERRED per document, with day-first as the default. A document is read month-first
(US mm/dd/yyyy) only when it contains an unambiguously US-ordered date (a nn/nn/yyyy whose
second field is 13–31) and no unambiguously EU-ordered one; otherwise the de-AT day-first default
holds. So a US statement no longer silently drops day>12 rows or attaches a wrong month — BUT a
document whose dates are all fully ambiguous (every field ≤ 12, e.g. only 03/05/2026) is read with
the day-first default and a genuinely US value there reads as the wrong month. This is no longer silent
(skills-remediation R5, audit §5.7): the extractor records a statement-level date_order_inferred
flag ('evidence' | 'default', additive nullable column on bank_statements/invoices) — set to
'default' exactly when the order was NOT fixed by a clean unambiguous vote AND an order-ambiguous
dotted/slashed date was actually read — and the deterministic answer then appends one honest caveat
line ("this statement gives no sign whether the dates are day-first or month-first, so I read them
day-first…", en + de, du-form). The residual is that the caveat is document-level: there is still no
PER-ROW channel (the tool output schema is frozen), so a single ambiguous date among evidence-bearing
ones is read day-first without an individual flag. The vote is scoped by line kind: a
MONEY-bearing line (a transaction row) votes only on its leading date column(s),
so a foreign-format date in a payee MEMO can no longer flip the whole document's order (which used to
silently day/month-swap every dotted booking date); a MONEY-less header/label line (an invoice Invoice date 06/15/2026, a statement period) still votes on any date it carries, so labeled US-invoice dates are
detected. Redaction takes the opposite stance — it masks a date-shaped token that parses in EITHER
order (over-masking is privacy-favouring there; see the redaction date bullet, U2), rather than inferring
a single locale.
Two-digit-year and bare dates complete against a document year anchor; cross-year statements roll over
(skills-remediation R5, audit §5.7). A dd.mm.yy (2-digit year) or a BARE dd.mm. date now parses on
the plain/CSV path (previously parseDate dropped BOTH — a dd.mm.yy CSV statement extracted zero
rows) — but only when the document supplies a fully-printed 4-digit-year date as an anchor
(inferDateAnchor): the century is taken from the anchor for yy, and a bare date takes the anchor year.
Without such an anchor a 2-digit/bare date is still DROPPED (drop-don't-guess stands). A bare date
additionally gets cross-year month-rollover: a December/November row on a January/February-anchored
statement is assigned the previous year (the mirror case, the next year), so a statement whose period
spans year-end no longer stamps one page year on every bare date. This mirrors the geometry path's
toFullDate/resolvePageAnchor (which gained the same rollover). R5 left one gap, closed in R7
(skills-audit-2026-07-03 SKA-1/SKA-2): while R5 made dd.mm.yy documents a first-class parsed
cohort, every date scrub stayed 4-digit-year-only — a dd.mm.yy token is money-shaped to
MONEY_RE (31.03.26 → 3103.26), so a balance/totals line's trailing per 31.03.26 was read as the
figure, Datum: 15.03.26 became a phantom invoice item, money-less dd.mm.yy period lines inflated
droppedRowCount, and a MID-LINE date on a period line (01.04.2026 bis 30.04.2026, both year forms)
was read as an invented transaction/line-item amount by the row money scan. R7 widened both
DATE_TOKEN_REs with a double-guarded 2-digit-year alternative (\b + (?!\d)(?![.,']\d) — the
lookahead accepts terminal punctuation, per 31.03.26. / vom 15.03.26, …, while refusing a "year"
that continues into digits or a separator-plus-digit) and runs the row parsers' money scan over a
SAME-LENGTH date-blanked copy of the line (scanMoneyWithBlankedDates — byte offsets preserved, so
description slicing and figure-region currency detection are untouched; a match's trailing sign/paren
is re-validated against the ORIGINAL bytes, so a blanked billing-period range after the amount —
1.500,00 01.04.2026 - 30.06.2026 — can never read the range dash as a trailing debit minus). Two
behavior notes from the R7 adversarial review: (a) a spaced dash between an amount and a
FOLLOWING date now reads positive-as-printed (the dash is treated as the range separator; before, the
date's digits blocked the trailing-minus lookahead AND became a phantom second figure — both readings
were wrong, the new one is the honest half of BL-1's documented ambiguity); (b) the document
currency vote gained a deliberate widening: a code IMMEDIATELY left of a line's first figure
(<desc> EUR 19,15-, the per-row currency-cell layout) now votes — the scrub widening had removed
such dd.mm.yy lines' only (accidental) vote, extracting ZERO rows; the FIN-1 memo exclusion is
unchanged. Descriptions now retain a mid-line/trailing date verbatim (previously the date's digits
were mis-read as figures; the bytes are kept — cosmetic input to the categorizer). Both extractor
versions → 9. Residual: the anchor is the FIRST
fully-printed date in document order — a document whose first 4-digit-year date is in a foreign century
(an old memo date) would expand yy into that wrong century (the same first-date-wins risk the geometry
path already carries); and rollover keys only off the anchor month, so a genuinely multi-year listing with
no clear period anchor is not disambiguated per-row.
A wrapped description is stitched onto the row it belongs to (skills-remediation R6, audit §5.7). On
the plain-text / CSV path a merchant/payee (bank) or line-item (invoice) description that wrapped onto the
NEXT line — a dateless, money-less follower — used to be silently dropped (the row kept only its
booking-line fragment, degrading the categorizer and the listing). It is now appended to the row above
as a bounded continuation — the plain-text mirror of the geometry multi-baseline association — so a
SEPA-Lastschrift row whose NETFLIX INTERNATIONAL B.V. payee printed below reads its real payee.
Bounded to one continuation line (the plain path has no column geometry to confirm the association, so
it is deliberately more conservative than the geometry MAX_CONTINUATION_ROWS of 4): a second follower
line does not glue, and a balance/header/totals/summary line, a blank line, a figure-bearing line, or the
next row closes the association. The association is per page/segment — pending is scoped to one
chunk (each chunk is one page on the real path) and never survives the segment boundary, exactly like the
geometry reconstructPage per-page flush, so a repeated column header or footer at the top of the next
page can never glue onto the previous page's last row. BANK_EXTRACTOR_VERSION → 7,
INVOICE_EXTRACTOR_VERSION → 7. Residual: a genuine footer/prose line sitting immediately under the
last row on the SAME page with no boundary between them can still be absorbed (bounded to one line, and
never a wrong figure — it is description text only).
Line-item column debris is cleaned only when arithmetic confirms the split (skills-remediation R6,
audit §5.7). A common invoice table prints <rowIndex> <description> <qty> <rate>% <unitPrice> <lineTotal>, where the row index, the quantity and the tax-rate percent are bare tokens MONEY_RE
ignores, so they stayed glued to the parsed description (1 Web hosting 12 Monate 1 0%) — a first-class
defect once JSON/CSV/XML made the line-item structure a deliverable. The leading row index is stripped and
the trailing <qty> <rate>% run is split into quantity + a new optional taxRatePercent — but ONLY
when the recovered quantity reproduces the printed line total from the unit price
(quantity × unitPrice ≈ lineTotal, within half a cent). When the identity fails — the audit probe
1 Web hosting 12 Monate 1 0% 76,17 914,00 (1 × 76,17 ≠ 914) — nothing is cleaned: the description is
left exactly as parsed (drop-don't-guess, §22-D1), and single-figure rows (no unit price to check against)
are never cleaned. The recovered taxRatePercent is surfaced in the JSON/XML serializers and the
extract-output schema; it is not persisted (the line-item table's columns are unchanged — out of the
phase's tools-only scope), so it survives only within a fresh extraction. The persisted and exported
win is the clean description and the correctly-assigned quantity/unitPrice. INVOICE_EXTRACTOR_VERSION
→ 7 (shared bump with the wrapped-description change above).
The amount column is chosen by POSITION, not the first money-shaped token. With a running balance
present (≥2 figures on the row) the parser takes the second-to-last figure as the movement amount
and the last as the balance; with one figure that figure is the amount. So a money-shaped reference in
the description no longer steals the amount/sign — but on an unusual layout (e.g. two amount columns
and no balance, or a description figure that lands in the amount slot) the position heuristic can still
pick wrong. The geometry column model (above) is the stronger separator where it runs; this is the
plain-text / CSV / invoice fallback.
An UNCAPTURED amount column drops the row rather than promote the balance. A whole-euro
amount (50) or single-decimal (12,5) is rejected by the 2-dp money
scan, so a Sparen 50 1.234,56 row collapses to ONE money token — the balance — and the position
heuristic above would otherwise read the running balance as the movement amount (off by the whole
balance magnitude — the cardinal confidently-wrong-money harm). The fix is statement-context-aware:
a row with one money token whose description ends in a bare number is flagged ambiguous and dropped
only when the statement has a balance column (some other row prints a running balance). On a
no-balance "Umsätze" listing the lone token genuinely IS the amount, so a numeric-ending payee
(KARTENZAHLUNG REWE … 1234 -19,15) is kept — dropping it would regress the flagship geometry case.
Residual: a balance-column statement whose row legitimately has a missing balance AND a numeric-
ending payee is dropped (a recall loss, never a wrong figure); and a loneSparen 50 1.234,56 with no
other balance-column row to establish context keeps the old read (it cannot be distinguished in
isolation). The invoice path mirrors this on the opposite side — it reads the line total as the LAST
figure, so it drops a row with an uncaptured numeric column to the RIGHT of the line total
(Hosting 12,50 500 → the real total 500 lost) and a bare number to the LEFT is treated as a quantity.
The right-side drop is scoped to a trailing token that is itself a money-shaped-but-rejected bare
amount: the region after the last money match must be ENTIRELY
one such token, so a valid item with a trailing annotation (Service 12,50 (Pos. 3), Beratung 1.234,56 19% MwSt, Line 50,00 EUR 2 Stk) is kept, not deleted by the earlier "any trailing digit
drops" rule.
Every parsed figure is normalised to 2 decimal places.parseAmount rounds each figure to the nearest cent so Math.round(x*100) is its EXACT integer-cent
value — the load-bearing premise of the completeness/reconcile tie-out math and the CSV toFixed(2).
A printed figure with a 3rd decimal (only reachable via the both-separator 1.234,567 form) is read to
the nearest cent (1234.57), not dropped — a sub-cent normalisation, never a confidently-wrong
magnitude. (Single-separator 3-digit-group thousands forms 1.000/12.345 are integers, unaffected.)
Unicode "side doors" are normalized to ASCII before any figure is read (skills-remediation R1,
audit §5.3; money.ts normalizeExtractionText at every extractor entry, mirrored in the geometry
path's pdf-layout.ts rowTokens). A Unicode minus — U+2212 / en dash U+2013 / non-breaking hyphen
U+2011 — becomes -, so a −45,90 debit signs negative instead of reading +45,90 (debits were
parsing as credits). The no-break-space thousands family — NBSP U+00A0 / narrow NBSP U+202F / figure
space U+2007 — becomes an ASCII space, so 1 234,56 reads 1234,56 whole instead of truncating to
234,56 (a 1000× error). The Swiss U+2019 apostrophe becomes ', so 1’234.56 reads 1234.56. The
pre-pass is a no-op for ASCII (existing fixtures byte-identical) and idempotent. Extractor
versions bumped (BANK_EXTRACTOR_VERSION → 4, INVOICE_EXTRACTOR_VERSION → 4) so stale rows re-extract.
A figure's sign is read by the SPACE around a minus. A glued
trailing minus is a de-AT debit (45,90- → −45,90, even with a running balance after it); a -<digit>
after a space is the next figure's leading sign (2.500,00 -500,00 → +2500 then −500). This
replaced an earlier trailing -? that reached across the column gap and stole the next figure's leading
minus, flipping both signs while the running chain still tied out (a confidently-wrong total ok-rated
by reconciliation). The leading side is now symmetric: a leading -/+ is a sign ONLY when glued
to the magnitude or an open paren (-1.500,00, -(45,00)); a dash separated from the figure by
whitespace is text, so Beratung - 1.500,00 EUR reads +1500 and the shared bank path reads a
GUTSCHRIFT - 34,39 credit as +34,39 — no longer the old spaced-dash sign theft that flipped a
positive figure negative (MONEY_RE and lastCurrencyAdjacentInteger). This makes the plain path
agree with the geometry path, which already refuses a dash far from the amount column as a sign
(14.01.2025 LASTSCHRIFT - 3,99 stays positive on both). BANK_EXTRACTOR_VERSION → 10,
INVOICE_EXTRACTOR_VERSION → 12 (stale rows re-extract). Residual: the genuinely-ambiguous
spaced trailing minus immediately before a
balance figure (45,90 - 1.908,20) reads as a positive amount — no parser can distinguish it from
subtraction; the glued de-AT convention (45,90-) is the unambiguous one and is read correctly.
Per-row currency is detected only in the FIGURE REGION. The row's currency is read from the text
at/after the first money token, not the free-text description, so a payee memo mentioning USD/$
on a EUR statement no longer tags that row a foreign currency (which used to suppress the whole
statement's total + reconciliation). The invoice line parser now matches the bank path (the BL-2 fix
was never applied to it): USD adapter cable 12,50 on a EUR invoice reads EUR, not USD. A genuine
foreign-currency row whose code/symbol prints next to the amount is still detected (mixed-currency
honesty preserved). validateInvoiceTotals gained the single-currency guard the bank gate already
had — line totals across mixed currencies are reported lineItemsSumToNet: unknown rather than
summed into a meaningless cross-currency figure. Residual: a foreign symbol glued immediately
before the only figure with no other adjacency ($50,00 as a row's sole token) can be missed and
falls back to the document currency — harmless on a single-currency document, a rare mis-tag on a truly
mixed one. The document-level fallback currency (used when a bare-amount row prints no figure-adjacent
code — the de-AT norm) is now a MAJORITY VOTE over figure-adjacent detections
(money.ts detectDocumentCurrency), not the old "first allowlisted code anywhere in the
document wins". A money line votes only on its figure region (a code in a payee memo, LEFT of the amount,
is excluded); a money-less header/label line (Währung EUR) votes on its whole text. So a stray USD in
a memo can no longer stamp a whole EUR statement — and its VERIFIED total — with the wrong currency.
Residual: a statement that prints bare amounts and declares its currency nowhere except inside a
transaction memo (no header declaration, no figure-adjacent code) yields no document currency → its rows
are dropped (honest recall loss, never a wrong currency).
Grouped figures without a 2-dp decimal are read as thousands. A bare 1.000/2.500 (de-AT dot =
thousands), space-grouped 1 234 567,89, and Swiss-apostrophe 1'234.56 are now read whole. The
trade-off (accepted, DECISION 2): a dotted/grouped reference number in a description — Rechnung 2.024 — is now money-shaped (2024) where before it was not, and space-grouping can fuse a
standalone 1–3-digit token with a following 3-digit-led figure across a space (12 300,00 →
12300,00). A digit group that is the tail of a longer token — whether after a digit
(778899 300,00) or a letter (Ref123 456,78) — is prevented from fusing by the parser's
word-boundary anchors; only a genuinely standalone short group abutting the amount can still fuse.
These are recall/precision trade-offs on the
plain-text path, never a wrong verified statement total (the completeness gate still requires the
printed opening + Σ == closing to tie out). On the geometry-less INVOICE path (no completeness gate,
no balance backstop) a space-grouped token without a 2-dp decimal tail (Widget 10 100 → 10 100
→ 10100) is treated as a likely column fusion and the row is DROPPED — a real line total
almost always prints cents. A decimal-anchored space group (1 234 567,89) is a
real figure and is kept; a space group with a decimal (15 799,00) stays the accepted trade-off
(indistinguishable from a real 15 799,00).
A LABELED invoice totals line reads a ROUND total printed WITHOUT a decimal (invoice-totals-2026-07-01).MONEY_RE rejects bare ungrouped integers (so a reference number in a description is never read as money),
which also meant a very common invoice layout — Total (excl. Tax) 914 $ / Tax 0 $ / Total (incl. Tax) 914 $ — produced an empty net/tax/gross block, and the skill answered "the invoice doesn't print a
net, tax, or gross total I could read" on a perfectly clear bill. A net/tax/gross-labeled line now
falls back to the last currency-adjacent bare integer (totalsMoney): the currency symbol/code touching
the number is the safety anchor that keeps a stray reference/registration integer (a VAT id ATU81420204, a
0% rate) off the totals, while the label already scopes the read to a totals line. Line items are
unchanged — an unlabeled row's bare integer stays ambiguous and is dropped (§22-D1). A qualified total
resolves by its tax phrasing: Total (excl. Tax) / "net of tax" → the net, Total (incl. Tax) → the
gross (EXCL_TAX_RE), so a layout that prints both no longer collapses onto the gross alone. The
abbreviated header label No.: no longer leaks its .: into the parsed invoice number. The
bare-integer fallback keeps the SIGN (skills-remediation R1, audit §5.7-low): a credit-note total
printed without a decimal — Gesamtbetrag -914 EUR — now reads −914 (a leading -/paren or a
trailing minus around the integer is honoured via parseAmount), not the old +914. INVOICE_EXTRACTOR_VERSION → 4.
Invoice totals/header labels match STRUCTURALLY, not as bare prefixes (skills-remediation R2, audit
§5.2 CRITICAL + §5.4). A label matched at a line start only when a word boundary follows it
(labelBoundaryOk), so the canonical Austrian tax-advisor line Steuerberatung Jänner 500,00 EUR
is no longer swallowed by the steuer prefix (which stole its 500 into taxTotal, deleted the line
item, and discarded the real totals block) — it is the line item it is. A label is treated as a
totals line only when its remainder is essentially just the figure (isFillerOnly): tax
qualifiers / currency / % may follow, but a real description ("Netto-Miete Objekt 3 1.000,00",
"Total hours consulting 40,00") means the line falls through to parseLineItem and stays a line
item. Header matching is money-gated in two steps: R2 gated only the date labels (Due diligence review 2.000,00 — a date label only consumes when a date actually parses), while the vendor/number
labels still consumed unconditionally — From 01.06.2026 to 30.06.2026 Hosting 49,00 ("from" is a
vendor label) or Rechnung Nr. 2026-14 vom 03.05.2026 über 1.500,00 EUR was swallowed whole: the item
deleted, droppedRowCount NOT incremented, garbage in vendor/invoiceNumber (the 2026-07-03 audit's
SKA-14; the earlier wording of this bullet overstated R2's fix). Closed in R7:applyHeader's
vendor/number branches fall through on any line carrying amount-shaped money
(carriesAmountShapedMoney — a 2-dp decimal figure, or any money token beside a named currency), so
a figure can never silently vanish behind a header claim. The gate deliberately does NOT fire on a
bare dotted/thousands GROUP with no currency (Rechnung Nr. 26.001 — a real DACH yy.nnn numbering
convention — or Lieferant: Firma 1.000 GmbH): the adversarial R7 review showed a plain
hasMoneyToken gate INVENTED a €26,001/€1,000 line item from those header values, the inversion of
the harm this fix closes. Residual: a genuine 2-dp figure inside a vendor/number VALUE
(Rechnungsnummer 2026/1.234,56) falls through and is read as a figure — §22-D1 prefers reading a
printed 2-dp figure as a figure over silently discarding it. INVOICE_EXTRACTOR_VERSION → 9. Totals
are last-block-wins (a real
invoice prints its totals after the items). The German summary vocabulary is extended — Summe,
Gesamtsumme, Rechnungssumme, Endsumme, Endbetrag, summe netto — and a summary-line guard
(isSummaryLabelLine, mirroring the bank isBalanceLabelLine) drops phantom "Summe" items so a
summary line never becomes a line item while the totals stay empty. INVOICE_EXTRACTOR_VERSION → 5.
A trailing number is split as quantity only with corroboration (invoice path). A
product-coded description (iPhone 15, Calendar 2026) used to have its
trailing number greedily read as a quantity. The split now requires a unit token (x/Stk/pcs/…)
OR a unit-price column (a second money token) to corroborate it — so iPhone 15 1.799,00 keeps
"iPhone 15" as the description while the columnar Widget A 2 12,50 25,00 still reads quantity 2. The
financial lineTotal was never affected — this is a metadata fix.
Balance/total lines scrub a TRAILING date before reading the last figure (BL-N2). Opening/closing
balances and invoice totals are read as the last money token on the line, so a figure followed by a
trailing date — Endsaldo 1.234,56 EUR per 30.06.2026 — would otherwise mis-read the date
(30.06.20 → 3006.20) as the balance. The last-money readers (lastMoneyOnLine / invoice lastMoney,
tools/money.ts) now call stripDateTokens first, removing every date-shaped token at either end
before the money scan, so the printed figure wins for both the date-leading `Kontostand per ` and the date-trailing shape. (This is why the backend-audit §24/§10 "last-token readers were
never affected" claim was wrong — corrected there: only the *date-first* shape was ever safe.)
A balance-less row still ADVANCES the running-balance chain.reconcileBalances carries a sinceLastPrinted cents accumulator: a mid-statement row with a real
amount but no printed running balance (same-day grouping — the bank prints the balance only on the
day's last line — or an OCR-dropped balance cell) is reported unknown (it prints no balance of its
own to check) but its amount is folded into the next printed balance's expected value. The earlier
code dropped the gap row from the chain, so the next balance-bearing row was judged against a stale
predecessor with the gap amount omitted → a FALSE mismatch → assessCompleteness returned
contradicted and a correct, verifiable total was withheld (the inverse of the confidently-wrong
harm, equally trust-damaging). A genuine read error still surfaces as a mismatch when the carried
total disagrees with a printed balance. No persisted-figure change (BANK_EXTRACTOR_VERSION
unchanged) — reconciliation runs on read, so row statuses / the reconciled flag re-validate
automatically. Residual: because amount is required on every row, the chain is never "genuinely
broken" by a missing amount, so a row whose balance was dropped AND whose amount the parser failed to
read drops earlier (the row vanishes, a recall loss) rather than reaching reconciliation.
A 0.00 row is neither inflow nor outflow.summarizeCashflow totals
positive amounts as inflow and negative as outflow; a genuine zero counts toward neither, matching
categorizeRow's Uncategorized fallback for a zero amount (the two surfaces previously disagreed —
the summary's >= 0 test counted a zero as inflow). The reported totals are unchanged (the figure is
zero); only the internal attribution is now consistent.
Bank-statement categories are model-assisted, not verified. The per-category breakdown
is assigned by a local LLM constrained to a fixed category set (it can never invent a label; any
uncertain/unparseable output drops to Uncategorized), so a category may be wrong — but a mislabel
only shifts the breakdown, never the verified statement total or the D56 completeness gate (which
read the signed amounts, not the labels). The breakdown is shown with an explicit "model-assisted" note.
With no model loaded it degrades to the deterministic rule pass (a smaller, coarser category set).
The deterministic rules match German keywords inside closed compounds
(kontoführungsgebühr→Fees, gehaltszahlung→Income) via a one-sided word boundary on the unambiguous DE
keywords (gebühr/gehalt/überweisung/bargeld), while short English tokens (fee/atm) and the
ambiguous lohn keep a strict two-sided boundary. Transfer boilerplate does NOT veto the model
(R3 / audit §5.5):sepa/überweisung describe the payment rails, not the merchant, so most de-AT
rows carry them; they are marked confident: false, so with a runtime loaded those rows go to the
15-category LLM (Netflix, rent, a doctor refund no longer all collapse into one Transfer bucket). With
no model loaded the deterministic fallback still labels them Transfer (coarser, but honest offline).
Residuals:lohn is NOT compound-matched (so a
monatslohndebit is not deterministically Income — a positive salary is still caught by the sign
fallback), and the compound gehalt could in principle over-match a non-salary compound
(alkoholgehalt) — neither moves a verified figure, only the model-assisted breakdown.
Categorization runs in the doctask lane (D26 — one job at a time), so it cannot run while chat
streams. Categories are grouped on a canonical English identifier (stable across UI locale — the
enum and the model-assisted detection key on it), but the breakdown display labels are localized
(EN + DE); a future user-defined category with no catalog entry falls back to its raw name.
A "categorize … as CSV/JSON" chat turn serializes WITH the category column
(the architecture.md "Generic result tables" record §6 carries the open
residuals). The
bank format answer categorizes FIRST (persisting, with the honest model-assisted / rule-based note
under the fenced block — D63) and both CSV surfaces (the inline answer and the confirm-gated export
button) emit each row's category through one generic table serializer (D60); the column is
presence-gated (D62) — a never-categorized statement keeps its prior 7-column shape rather than
implying an all-blank categorization. Current shape: (a) a bank format answer persists its
structured table (result_tables, purged with its message) and carries a message-level
"Export CSV" action that writes it via the standard save dialog — though only answers
produced after this landed (2026-07-05) carry a table (no backfill), and only the bank format
path emits one so far (invoice port
pending); (b) user-named extra columns are supported: "… als CSV mit
einer Spalte Empfänger" pays ONE grammar-constrained parse + a batched per-row fill over the
whole statement; derived cells are model-filled labels (honesty note under the fence), blank
where the model was unsure, and ride the persisted result table + message export. Limits: needs
a running model (offline → the plain table); CSV asks only; ≤ 4 columns; values are not
persisted on the transactions themselves (re-asking re-pays the fill; the result table persists
per answer); a plain "als CSV" stays 0-model via the deterministic pre-gate — extra columns must
be signalled with a column-shaped phrasing (Spalte/column/subcategory/payee …); (c) without
the skill active a tabular ask still routes to top-k relevance, not whole-document — routing
it through extract-then-enrich needs a generic row extractor that does not exist yet (deferred,
architecture.md result-tables record §5).
USER-DEFINED category sets from the prompt are supported ("Kategorisiere in Miete,
Lebensmittel, Kinder und Sonstiges … als CSV"): the enum-constrained categorizer runs INLINE in the
chat slot with the user's labels (+ the Uncategorized drop target), persists them as non-builtin
categories, and reuses a prior run when the persisted labels fit the requested set. Limits: it
requires a running model (with none the ask is refused with friendly copy echoing the parsed
set — the deterministic rules cannot know the user's labels); the parse is deliberately
conservative (a categorize stem + ≥ 2 plausible labels; one malformed token rejects the whole list
rather than categorizing into garbage); a custom label is a MODEL-ASSIGNED label (the honest
model-assisted note rides every answer; totals and the D56 gate are untouched); and a large
statement pays the per-batch model latency inside the chat turn (the ephemeral "reading…" notice
covers the gap, but there is no per-batch progress meter in chat — the "Categorize" button lane
has one).
The taxonomy can live in an imported CSV — "Kategorisiere nach den
Kategorien in taxonomie.csv" finds the file BY NAME across the indexed library (never by widening
scope), parses one label per line (2–40; an optional keyword column becomes the model-prompt gloss —
the accuracy lever), and refuses honestly, naming the file, when it is missing or not parseable as a
list. Caveats: with NO explicit scope the chat layer's filename auto-scope can narrow the turn to the
taxonomy file itself and the handler falls through to relevance — select the statement (or keep it in
scope) when referencing a taxonomy file; a filename with spaces must be quoted; the file's labels are
otherwise subject to the same model requirement and honesty notes as an inline custom set.
Strictly one job at a time (D26). While a summary runs, chat is refused with a
friendly message + a cancel option, and vice versa — the one local model serves one
request. This began as an app-side product decision (predictable latency, no
context-memory splitting): the R-T1 probe found the b9585 of the time serving concurrent
requests on parallel slots. Since #319 the chat server runs one slot (-np 1), so a second
request would queue at the server too; revisit only with evidence.
A failed single-document re-index or delete reports on the shared error banner, not on the
row (issue #194). The clicked row shows a spinner and its own success toast names the document,
and a failure banner is prefixed with the title — but there is no per-row error surface.
Deliberate: design-guidelines §6 keeps actionable errors off toasts, and a second error channel
would race the banner.
A single-document task cannot be cancelled (issue #194). The bulk twin's determinate progress
and the per-row spinner are presentation only; the underlying work is not a main-owned cancellable
job, and the screen-global busy serialization (DR-5) stays — only its legibility changed.
Re-index clears the summary and nothing regenerates it automatically — the content
may have changed, so a stale summary must not survive; the user presses Summarize again.
Accepted edge, mirrored in the user guide.
Token budgeting is conservative, not exact. The window math uses the chunker's
approxTokenCount plus a 1.3 words→tokens safety factor; real token counts vary by
language/model. Worst case is smaller-than-necessary windows (more map calls), never a
context overflow. NB (fix 2026-06-14): the estimate formerly counted only
whitespace words, so a space-less document — CJK/Thai, or a glued PDF/extraction run
with no word breaks — collapsed to ~1 "token" and the assembled prompt overflowed the
model context, which the server rejected with HTTP 400 exceed_context_size_error (the
whole document-analysis path failed). approxTokenCount now counts space-less scripts
per character and charges long no-space runs by length, and windowByTokens slices such
runs instead of leaving them whole. Documents indexed before this fix keep their
pre-fix (possibly oversized) chunks until Re-indexed. Space-less estimates are
deliberately on the high side (CJK counted ~1 token/char), so CJK summaries window more
finely than strictly necessary — safe, slightly more map calls. NB (fix 2026-06-15):
the embedder sidecar truncation had the same class of bug — it truncated each chunk by a
naive whitespace-word count at an English-calibrated 1.4 tokens/word, so a subword-heavy
language (German runs ~2 real tokens/word) or a space-less script stayed over the 512-token
E5 context and the embeddings endpoint failed with HTTP 500 — which surfaced when a
machine translation into German was imported. The embedder now truncates by
approxTokenCount against a conservative real-BPE safety factor (2.2× for the multilingual
E5), covering worst-case German with headroom; the embedding vector covers the chunk's head
(adjacent chunks overlap), so retrieval is unaffected in practice. NB (fix 2026-06-16): a
third instance of the same class — the chat/RAG conversation path replayed the WHOLE history
unbudgeted, so a long multi-turn analysis (or a grounded turn carrying a large chunk block)
accumulated past the model window and the server rejected the request with the same HTTP 400 exceed_context_size_error. The history is now trimmed to contextTokens (fitMessagesToContext),
keeping the system prompt + the current turn and dropping older turns oldest-first — and,
since compaction (#151 KL-3), an L2 SUMMARIZE layer runs first at 0.85·window, condensing
the oldest turns into a stored checkpoint so the L1 oldest-first drop is the fallback, not
the first resort (turns are not silently discarded while a summary can stand in). The retrieval
cap (ragMaxContextTokens) still bounds only the retrieved chunks; the new budget bounds the whole
prompt. Unavoidable overflow (a single oversize turn on a tiny-context model) now surfaces the
friendly main.model.contextExceeded copy on the invoke rejection, not the raw HTTP 400.
Translation REQUIRES the TranslateGemma translation model — there is no chat-model
fallback (plan O2/D3). Translation runs on a dedicated local sidecar, never on the
chat model (whose translation path was removed at TG-3). Without the installed model the
Documents "Translate" action is disabled and a "Get the translation model…" item deep-links
to the AI Model screen; a task started anyway refuses with the same friendly copy. Since
issue #40 (2026-07-09) a completed in-app download re-runs the translation selector
(AppContext.onModelInstalled), so translation activates the moment the GGUF lands — no
restart; since #497 (2026-09-21) the same hook — and the engine installer's completion hook
for whisper_cpp — re-runs the transcriber selector too (refreshTranscriberSlot, a null
slot only), so voice dictation and audio import activate the moment the speech model or the
voice engine lands. Since #410 (2026-09-22) the in-app OCR files install activates OCR the
same way (refreshOcrSlot after the download: an empty OCR slot is filled and proven, no
restart). Residuals: a weight — or an OCR language file — copied onto the drive OUTSIDE the app
(manual file copy) is still only picked up at the next start; an in-app OCR download that GROWS
a running recognizer's language set (e.g. eng added to a deu-only drive) takes effect after
a restart (the job says so — a live recognizer is never replaced mid-session); and the
reranker and embedder keep the startup-frozen selection (the embedder handle is captured at
wiring time in main/index.ts and must never swap mid-session anyway — an index embedded by
one model is unusable with another). Which embedder is the manifest flagged
default_for_role (the E5), else the first embeddings manifest in walk order (#848); the
workspace's activeEmbeddingModelId setting does not choose it. The flag decides whether or not the
E5's file is present: with the E5 weight missing, the app runs on the built-in mock embedder (document
search finds nothing, every document reads as needing a re-index) even when another embeddings model is
installed. That is deliberate: the other model's vectors are a different space from the index the E5
built, so a silent switch would leave every document stale now and again when the E5 returns. Download
the E5 again from the AI Model screen ("Check all model files" shows a damaged one). It is written only by
models:select (which the AI Model screen never calls for embeddings), and since #890 nothing visible
reads it: the Performance screen's embeddings row names the composed embedder like every other role row.
Honouring a workspace choice belongs to the deferred embedder swap. The images model is picked by
the same rule among the vision models whose files are all on the drive (#890); when that model's files
fail their check, Images runs the next vision model on the drive while the Performance row still names
the first (the AI Model screen shows the damaged file). One damaged file is enough: "Check all model
files" stops at it and leaves the model's other file unhashed, and since #913 the screen and Images
keep reading it as damaged after that. The running analyzer keeps the model it was
built with until a failed start, an engine update, a lock or quit, or (since #913) its next cold
start after the idle teardown, which loads the model the Images status names: a vision model
installed mid-session that becomes the pick (a flagged one, or one earlier in walk order) moves the
Performance row and the Images status at their next update, and the analysis at that rebuild.
A failed translation-model START disables translation until the app restarts or the model is
re-downloaded in-app — and now says so (FA-4 F-7). The ~10 GB sidecar is started lazily on the
first translate. If that start
fails it is LATCHED for the session (the reranker precedent — a permanent load fault must not
re-spawn and re-await the full health timeout on every window). The most likely cause is not a
corrupt model but transient memory pressure from the co-resident chat model, so the failure
now surfaces actionable copy — "The translation model couldn't start — the device may be low on
memory. Close other apps or restart HilbertRaum, then try again." — instead of a bare "couldn't
finish". Freeing memory and restarting the app clears the latch; since full-audit 2026-07-10
BE-7 a completed in-app re-download of the translation model ALSO clears it (onModelInstalled
replaces a startFailed-latched instance with a fresh selection — the delete-and-re-download
repair for a genuinely corrupt GGUF no longer needs a restart; a live sidecar is never replaced). Since #913
a clean "Verify checksum" or "Check all model files" re-arms it the same way, and the same three
actions re-arm the re-ranking model, which before stayed off until a restart. We deliberately do NOT
auto-retry the latched start: no reliable transient/OOM signature exists across OSes to tell
memory pressure from a genuinely permanent fault (on Windows the OOM exit code collides with the
known template-validation crash; a Linux OOM-kill is indistinguishable from our own shutdown), so
un-latching would re-pay the full spawn + health-timeout cost on every window for a permanent
fault. A transient port-bind race is the one non-latching start class and still retries silently.
Since issue #42 a failed GPU-attempt start is a third class: it does NOT latch translation
off — the same start retries once at forced CPU, and only that final CPU rung failing arms the
latch (the GPU posture itself is then abandoned for the session, without touching chat's
persisted gpuAutoDisabled).
A large resident chat model can starve GPU translation down to roughly CPU speed — visibly,
not silently (issue #42 reopen, 2026-07-10). Under the GPU posture the sidecar launches with
VRAM-aware auto-offload (--fit): whatever graphics memory the resident chat model left over is
what TranslateGemma gets. Field-measured on a 24 GB RTX 3090 (model-benchmarks.md §11.4): ~13 GB
free → full offload at ~75 tok/s; a ~16 GB chat model (gemma-4-26b-q4) resident → PARTIAL
offload at roughly the ~3–4 tok/s CPU speed. That is a llama.cpp fit decision, not a fault — no
fallback fires and nothing latches. Two properties matter: the split is pinned per cold
start (freeing VRAM mid-session takes effect only after the ~2-min idle teardown forces a
fresh fit), and the remedy is a smaller chat model (or stopping it) before translating. Since
the #42 reopen this state is OBSERVABLE instead of reading as "GPU translation not working":
every cold start logs "Translation sidecar started" with the posture + the offloaded-layer
split, and the Translate screen shows a muted device line in one of FIVE forms (#164 D-7b
completes the enumeration): GPU with the layer split / "partly on the graphics card … the
graphics memory was mostly taken, usually by the chat model, so it runs at about processor
speed" / for a fully-starved 0-layer fit "runs on the processor — the graphics memory was fully
taken, usually by the chat model, so no layers fit on the graphics card" (full-audit 2026-07-11
CODE-23) / plain "runs on the graphics card (GPU)" when the GPU posture started but no offload
line could be parsed from the server log (translate.device.gpuUnknown — no split is invented;
until #629 EVERY GPU start landed here, because the sidecar ran below the log level that prints
the line) /
CPU (since #671 also for a GPU-posture start whose load log put no buffer on a graphics device:
on a PC with no usable card the log still reads offloaded 49/49 layers to GPU, and the line
used to claim the card). Since #161 (FE-4) the remedy for the two starved forms is VISIBLE text under the device
line, no longer tooltip-only. The two starved forms name the CAUSE since the owner decision of
2026-09-08 on this issue (#42) — they used to state the symptom ("about processor speed") alone, leaving a user who
read no further with nothing to act on; the remedy line below is now the ACTION only, so the two
do not repeat each other. The same decision refused both runtime remedies (forcing translation to
the processor, and an idle reclaim that largely exists already): architecture.md GPU record
§8.1. So this limitation stands as a limitation — the app explains it, it does not prevent it.
Narrowed by #473 (2026-10-12, GPU record §9). A translation start now uses the card only if
the model fully fits beside the chat model there; otherwise it runs on the processor and the
device line names why (beside the chat model / a chat model was starting / too large for this
card). The squeezed partial offload this entry describes remains only where the gate has nothing
to judge: no stored probe for this machine, no usable discrete card. And a chat start now moves
a translation sidecar off the card first, so the chat model is no longer the one squeezed.
What remains: (a) other applications' use of the card is invisible on NVIDIA/Windows and Apple
Silicon, to every gate; (b) a translation moved off the card by a chat start stays on the
processor until its 2-minute idle teardown, even if the card has room once the chat model has
loaded, and the window in progress is redone; (c) a translation cold start in flight when a chat
start begins can delay that chat start by up to 30 s; (d) a GPU reranker is assumed fully on
the card (its load log is not parsed); (e) unmeasured on AMD/Windows and on a Mac, and the
two-process case on NVIDIA/Windows is unmeasured.
Languages are a closed set of 51 — source AND target (issue #31, 2026-07-07: the original
curated 10 widened to TranslateGemma's full PRODUCTION tier — the 55 WMT24++-evaluated locales
collapsed to 51 bare codes; zh is Simplified Chinese), validated server-side. The model's chat
template lists ~160 languages, but the ~105 beyond the WMT24++ set are experimental
(GATITOS/SMOL-sourced, higher hallucination rates per Google) and stay OUT. TranslateGemma's
trained prompt needs an explicit source language; there is no auto-detect.
Per-language round-trip evidence exists for the original 10 (the TG-6 smoke); the widened rest
ship on the model's own WMT24++ evaluation. Translation quality on the widened languages has NOT
been locally re-measured — add a SMOKE_LANGS sample when promoting one into the measured set.
~2K-token input windows → more, smaller windows + cross-window terminology drift.
The model card specifies a total INPUT of 2K tokens (the fine-tune's trained size), so
the planner clamps every window regardless of the launched context (plan D4). TG-6
re-measured the real Gemma tokenizer (much heavier than the earlier Qwen estimate — up to
~2.3 tokens/word on Czech/Ukrainian prose), so windows are now **640 words** (642 at the
launched 4,096 context since #512, which keeps even a token-dense window under the 2K input) —
smaller, hence more of them on a long document. Each window is translated independently: a recurring
term can be rendered differently in different windows. A sliding glossary/context header is
explicitly out of scope for now.
Window sizing is "over-chunk, never overflow" for realistic prose — not an absolute
guarantee on adversarial emoji/astral input (audit L10, accepted). Since #165 (P-1) the
planner packs windows with approxBudgetWordCount — a WORD-count estimate that keeps the
token estimator's anti-collapse defenses (space-less scripts per character; over-long
no-space runs charged by length) — matching the per-word unit the TG-6 budget is derived in,
so compound-heavy prose (de/cs) no longer under-fills windows 1.5–2.5×; the per-word token
ceilings stay conservative over the measured Gemma tokenizer, so a normal document can
only ever over-chunk (harmless). The estimator UNDER-charges a pathological glued run of
emoji or astral-plane codepoints (each such codepoint can tokenize to several tokens while
counting as a fraction of a "word"), so a window built from such input can carry more real
tokens than budgeted and hit the model's context/output cap. This was deliberately not
fixed in the translation-audit (TA) wave: touching the shared chunker for a pathological
input is not worth the blast radius across summary/compare/retrieval, and the failure mode
is benign — the over-long window simply comes back without a clean stop and is surfaced as
an honest "could not be translated" failed-window notice (see below), never a silent bad
translation. A real fix belongs in a separate chunker-owned change. (Narrowed 2026-07-17,
audit-2026-07-16 F-24: the SIBLING symptom of the same astral gap — the chunker's fixed-offset
character slices could split a surrogate pair at a window boundary, storing chunks with a lone
surrogate at the edge (U+FFFD in SQLite/FTS/embeddings) — is now FIXED by a boundary-only
pair-aligned cut in chunker.tsatomize. The token UNDER-COUNT half described here remains
accepted; existing corpora re-chunk only on re-index, the documented behavior.)
Numbers and dates are LOCALIZED, not copied verbatim — that is correct machine
translation. The TG-2 smoke on the real model: 14.03.2026 → March 14, 2026,
1.250 → 1,250 — formats adapt to the target language, while stable identifiers
(invoice numbers like 2026-0457, model codes like RX-7b) survive verbatim. Do not
expect (or scaffold for) byte-identical numerals; the trained prompt handles this.
A translation is a snapshot, not a synced copy (accepted staleness edge). The
origin_json link records where the document CAME from — re-importing or re-indexing
the SOURCE does not update an existing translation; the user re-runs Translate. If the
source is later deleted, the provenance line says so ("a removed document") but the
translation keeps working.
A window the model refuses/garbles/TRUNCATES is marked or fails, never silently dropped.
A window that throws, comes back empty, or runs to the output-limit cap without a clean
stop — the greedy-decode repetition loop that is the classic temperature-0 MT pathology, or a
token-dense window clipping at the ~2,000-token cap — is now DETECTED via the completion's final
stop reason and treated as a failed attempt (TA-5). The shipped detector keys on the final
frame's stop_type ∈ {eos, word} first — b9849 does NOT emit the legacy
stopping_word/eos-flag fields on a clean stop (issue #31a); those legacy fields remain only
as the back-compat fallback for older builds (completion.ts; wording corrected per #164 D-4).
Retry is by failure class (FA-2 F-2, refined by #160 BE-2): a THROW or an EMPTY reply is
TRANSIENT (a server-side close, a crash-recovery, a per-request timeout where NO tokens ever
flowed — a wedged server) and is retried once; a NON-EMPTY window that did not stop cleanly is a
DETERMINISTIC limit-stop — greedy decode with prompt caching reproduces the identical truncation,
so it is marked/failed on the FIRST attempt rather than burning a second full decode (up to ~30 min
per window) for the same outcome — and since #160 a per-request TIMEOUT during a LIVE decode
(tokens flowed until the bound) is classified the same deterministic way: marked immediately,
never retried into a second ~45-min timeout on the one-at-a-time lane. Since #605 a HUNG
sidecar is caught within minutes: 2 min without a token, 10 min without progress while reading
a window, 2 min of total silence, or 3 min without response headers. The runtime then restarts
the sidecar, and the window's one retry runs on the fresh one, tokens or not. A hang that recurs
on the fresh sidecar fails that window. A window sent right after a cancel waits for the
cancelled request's current 512-token batch. If that batch takes longer than 3 min (a slow
laptop under memory pressure), a healthy sidecar is restarted: one extra cold load. In the
document task, a failed window's output carries a
visible "could not be translated" notice with the ORIGINAL text kept below it; only an all-windows
failure fails the whole task. In the Translate view (interactive), a failed window fails the
whole job VISIBLY rather than completing with a mid-sentence-truncated or missing paragraph — a
visible failure beats a silent gap. Before TA-5 a truncated window was stitched in silently as a
clean translation; that honesty hole is closed.
A source PAGE with no extractable text is marked in place, never silently skipped (issue #58,
2026-07-17). The failed-window honesty above starts at the MODEL; issue #58 was the class
BEFORE it: a PDF page whose text layer is empty (a scanned page inside an otherwise-text
"hybrid" PDF, a blank page) produces no parser segment at all, so a 5-page document used to
materialize as a seamless 4-page translation — no warning, no gap marker, nothing to notice
unless you counted pages. Now the parser reports the source's DECLARED page count alongside its
segments, and the translation task accounts every page: each gap becomes an inline
"Page N … could not be translated — no readable text (it may be a scanned image)" notice at its
true reading position in the generated document, and the Translate screen shows a per-range
warning next to the finished output (DocTaskStatus.gaps). The same accounting also surfaces
the failed-window count in the UI (previously in-document only). On top of the page ledger, a
per-segment invariant (assertNoTextDropped) verifies window packing preserved every
non-whitespace character of the re-extracted input — a planner regression fails the task
loudly instead of shipping a silently incomplete document. Limits: page accounting exists only
for formats that HAVE pages (PDF, including the stored-OCR path); txt/md/docx/audio have no
page semantics and rely on the segment invariant alone. The remedy for a genuinely scanned
page inside a text PDF is "Make searchable (OCR)" on that document first (#575: its row names
the scanned pages); a translation started before that still marks them as gaps.
Long documents take time — linearly (on CPU). There is deliberately NO window ceiling (a
faithful translation may not cover "the beginning" only, unlike the summary). Since issue #42
the sidecar auto-offloads to the GPU under the same signals as chat (gpuMode: 'auto' and
not gpuAutoDisabled — Settings → GPU off forces CPU); on a GPU-less or GPU-disabled machine
it decodes at the measured ~3–4 tok/s CPU rate (model-benchmarks §11), so a 100-page document
is many minutes to hours there. GPU tokens/sec has NOT been locally measured yet (the §11.4
re-smoke is an open owner action); the #25142 parallel-Vulkan hang stays contained by
--parallel 1 in both postures. Progress is visible per window and cancel always works (a
cancelled translation persists nothing).
Export covers text documents only. The Export action saves the STORED text
(materialized translations are Markdown, so it is exact); PDFs/DOCX stored copies are
original binaries and are not exported through this path.
Dropping a document in the Translate view leaves a Temporary source behind (TG-5).
A file dropped or chosen in the Translate screen is imported as a Temporary
document (never the Library) and then translated on this same doc-task; the translated
copy is a Generated document you can find under Documents. The temporary original is
NOT auto-deleted — it rides the existing Temporary-lifecycle retention (owner-gated,
Phase E.2), so a user who translates many files this way accumulates temporary sources
until that retention ships or they delete them by hand. Deliberate: bespoke deletion here
would risk the source of a translation the user may still want re-run. The same
~2K-window cross-window terminology drift above applies to dropped documents.
A scanned PDF can't be translated as-is — the Translate view points you to OCR first
(FE-3). A dropped/chosen PDF that is only pictures of pages imports but then fails
ingestion (no readable text). The banner names the real reason: for a detected scan it says
to make it searchable first under Documents with Make searchable (OCR), then
translate the result; any other import failure (a corrupt/encrypted PDF) shows its own
localized reason rather than the old, misleading "unsupported file type" note. A genuinely
unsupported extension still shows the unsupported note. Since #570 the scan banner also has a
Go to Documents button.
A scanned PDF attached in a chat is not read there — the chat points you to OCR (#570).
The import fails as a scan and the chat says what to do: Make searchable (OCR) in Documents,
with a Go to Documents button (a photo of a page without the OCR files gets the same kind
of note). OCR does not run inside the chat. After OCR the document joins that chat by itself.
Until then the chat answers from no documents rather than the whole library, and lists the
file as not readable yet (#571). The note shows in the chat that received the file, also
when the import finished while you were in another chat; it is held in memory only, so after
leaving the Chat screen the Documents row is where the failure is recorded. One residual stays:
deleting a chat's ONLY attachment from Documents widens that chat back to its default sources.
The Translate view shows only the START of a long translated document. To bound
renderer memory the output panel loads the materialized doc's bounded first page; a long
translation shows a "showing the start" hint. Use Export… or Show in Documents
for the whole document (the exported/stored copy is complete and exact).
A running translation survives navigation AND a full renderer reload — for BOTH the text
and the document path (FA-3 F-3). Both Translate stores are module-level, so navigating
away and back keeps a live translation streaming. A full renderer RELOAD drops the module
stores, but each is re-adopted on the Translate screen's next mount: the live TEXT job via
adoptActiveJob (long-standing), and the RUNNING or QUEUED DOCUMENT translation doc-task
via adoptActiveFileTranslation — it re-seeds translating + window progress and resumes the
poll, so progress, Stop and the eventual result come back instead of the screen returning
idle while the task ran on invisibly (and a fresh attempt being refused as busy until it
finished). The file/document path previously had NO reload recovery while the text path did;
that asymmetry is closed. (#150/DOC-8 added the queued-accept; #157 DT-5 made it REAL —
the adopt reads the new listActiveDocTasks lane list, so a translation queued behind a
foreign task — a Documents-row Summarize that took the lane during the import phase — is
adoptable too, with Stop targeting exactly it via the exact-id cancel.) One tolerated cosmetic edge: the source fileName is unavailable
after a reload (main tracks document ids only), so an adopted document translation shows
progress + result without the original filename label until it completes. At most one of the
two is ever live (the D9 one-at-a-time lane), so the two adopts never both claim the panel.
A second tolerated edge, same root cause: the renderer's shared doc-task store dies with the
reload too, so a translation started from a Documents row and still running across a reload
is adopted into the Translate panel as if it had been started there — main records document ids
but not the originating surface, so after a reload the two are indistinguishable. Benign: the
task, its progress, its Stop and its result are all genuinely the user's, and the materialized
document lands under Documents either way. Without a reload the panel no longer adopts a
Documents-row task at all — the recovery only fires from a genuinely empty store.
Document comparison
A similar version pair is compared by a deterministic word-level diff (mode d). When the two
documents share most of their text — the real "what changed" case — a Myers word diff finds the
EXACT changes (down to a single deleted word) and drives both the chat answer and the materialized
report; the model only interprets the changes into business language, so it can no longer miss a
subtle change or dismiss repetitive/placeholder text as "identical" (compare-diff record,
architecture.md §20). The limitations below apply to the FALLBACK modes, which run only when the two
documents are too different / too large for a precise redline (a rewrite, not a version bump).
The diff direction is A→B by a deterministic, honestly-labelled pair — never a guessed old/new
(audit §5.1, fixed R4). The app cannot know which of two selected documents is the newer one, so it
no longer claims to. "Removed"/"Added" follow the A→B order the documents are supplied in: the doctask
uses the user's explicit A/B selection; the chat what-changed path orders the pair deterministically
by import date (ORDER BY created_at, id, via the one shared scope helper — no more no-ORDER BY
private query) and labels the blocks Document A/B: "title" (imported <date>), instructing the model
never to call either the "old" or the "new" version. The set of changes is always correct; the
direction is now stable across runs and truthfully labelled, instead of an unspecified SQL row order
asserted to the model as exact old→new fact (which could invert a whole report).
Section-matched comparison is A-driven (asymmetric) UNLESS both documents are deeply
indexed. When two documents are too long to compare in full AND both have a ready deep
index (and the smaller has ≤ 24 summary sections), the comparison is now symmetric:
each document's summary sections are aligned by similarity and diffed pair-by-pair, so
swapping A and B mirrors the result (rag-design §14.6). Otherwise it falls back to the
A-driven path — each section of document A is matched with the most RELATED excerpts of
document B (stored vectors, no new index) — which makes "only in A" findings reliable but
can MISS content that exists only in document B. That fallback now carries a visible
"one-directional — deeply index both for a complete two-way comparison" notice in the
report. (The symmetric path lazily embeds each tree's summary sections on the CPU embedder
sidecar the first time — once, then cached.)
The report covers the BEGINNING of document A when it is very long (fallback modes only). In the
asymmetric path the map ceiling (12 calls, the summary's bounded-latency rationale) caps coverage; the
report itself carries a visible notice when that happens. (The symmetric path can also truncate — a
lopsided pair with many unmatched sections can overflow the reduce input — in which case it carries its
own, document-neutral truncation notice instead.) The diff-driven mode (d) does NOT cap this way — it
reads both documents whole — so a similar version pair is compared in full regardless of length (up to
the wordDiffDEFAULT_MAX_WORDS guard, beyond which it falls back to these modes). Both documents stay
fully searchable. In the chat diff path, stored chunks overlap by ~80 tokens, so a change landing exactly in
an overlap region may be listed twice — cosmetic, never a missed change.
Report section headings are English even for German documents. The four headings
are dictated verbatim so the report structure is deterministic (R-T2-probed: the 4B
keeps them); the findings under them follow the documents' language. Cosmetic, accepted
for v1.
One-sided clauses may ALSO appear under "What differs" in small-doc compares. The
R-T2 smoke showed the 4B sometimes lists a fact present in only one document both as a
difference ("…while document B does not mention this") and under its "Only in" section
— accurate but redundant; prompt-tightening fixed the reduce path, the full-compare
duplication is accepted (visible, never wrong).
Mixed-language pairs get a single-language report. The prompt says "write in the
language of the documents"; for a German/English pair the model picks one. Compare
like-language documents (or translate one first — the Translate view exists for this).
A comparison is a snapshot, not a synced copy — the same origin_json staleness
edge as translations; re-run Compare after the sources change.
Audio transcription
m4a/aac recordings are not supported. The pinned whisper.cpp binary decodes
WAV/MP3/FLAC/OGG only (probed with real files, R-W2); decoding m4a would require
bundling ffmpeg (license + surface we deliberately avoid). The friendly failure asks
to convert the file to WAV or MP3 — most voice-recorder apps offer this.
Transcription runs on the CPU at roughly real-time ÷ 1.5 (RTF ≈ 0.67). Measured (R-W4, small
model, 4 threads, the reference CPU): a 52-minute meeting took ~35 minutes; peak memory ~1.2 GB. The
import shows honest "Transcribing… N%" progress and the app stays usable meanwhile.
GPU-accelerated whisper is a possible later opt-in, never a default risk.
A wedged or cancelled transcription self-recovers — it cannot hang the import slot.
A whisper child that stops producing any output for
15 minutes (env-tunable) is killed by an inactivity watchdog; because a healthy run emits
-pp progress continuously, this only trips on a genuinely spinning/hung child, never a
slow-but-advancing one. Cancelling the import (e.g. locking the vault mid-job) also aborts
the in-flight child immediately. Either way the one document fails friendly and the import
loop continues. The watchdog/abort/suspend kills now escalate SIGTERM → SIGKILL after a
2 s grace, so a whisper-cli wedged in native code that
ignores SIGTERM is still forced down and the ingestion slot freed. suspend()/stop() (vault
lock / app quit) additionally bound their cleanup wait at 10 s: in the vanishingly-rare case a
child ignores even SIGKILL, teardown returns anyway rather than hanging quit, and the unshredded
.parse transcript transient is reclaimed by the next startup crash-sweep (the documented backstop).
Re-indexing an audio document is a FULL re-transcription (D35). The stored copy is
the audio itself (the locked copy-into-workspace contract — also what makes the drive
self-contained), and there is no separate transcript cache; a sha256-keyed cache is the
recorded follow-up if re-index proves common. Preview/translate/compare do NOT
re-transcribe — they read the stored transcript chunks.
Audio costs real drive space, twice the size on encrypted workspaces transiently.
The recording is copied into the workspace (encrypted at rest); imports >50 MB of
audio ask first. A password change only re-wraps the data key, so recordings are not
re-encrypted; only an older (v1) vault's one-time move to the current format, at its first
password change, re-encrypts them with every other stored file.
mac/linux drives need a source-built whisper-cli. Upstream ships a prebuilt binary
for Windows only (R-W1); on other OSes audio import fails friendly until the drive
builder compiles the pinned tag (see drive-layout.md). Windows-first, by the
project's platform priority. Since #527 the app says this rather than blaming the speech
model. The import failure reads "not available on this operating system yet", and so does
the dictation hint. The speech-model card on the AI Model screen notes that the model alone
does not enable dictation or audio import there. The download stays offered, because a
source-built engine makes the model useful.
Transcription quality is the small model's. Proper nouns and unusual terms can be
misheard (R-W3: "LibriVox" → "Librebox"); numbers, names of people/places, and dates
held up well in the German probes. The transcript is searchable text, not a notarized
record.
On Windows, the voice engine refuses a speech model whose path below models/ is not plain
ASCII (#869). The pinned whisper-cli reads its command line in the system's code page, so since
#869 it starts in the workspace's documents folder and gets every path in an ASCII spelling
from there (architecture.md "Audio transcription (Phase 36)", "#869 amendment"): a drive or
app-data folder such as C:\Users\Jürgen\AppData\Roaming\HilbertRaum or a Kit folder Übungen
works, and so does a recording named Sitzung März.mp3 anywhere. A model path with a non-ASCII
folder or file name below models/ has no such spelling — only a user's own manifest can give
one (the shipped manifests are ASCII) — so audio import and dictation refuse it with copy that
says to move the model to a plain path and update its manifest entry,
even on a Windows set to use UTF-8 for its code page. Encrypted workspace, first import of a
recording whose name or folder has no ASCII spelling from the workspace (a Kit on D:\, the
file in C:\Users\Jörg\Musik\): the app copies it into the workspace's documents folder for
the transcription and shreds the copy right after, the same short-lived plaintext as an
encrypted re-index's decrypted working copy. It costs one extra write of the file, on Windows
only. A workspace folder path of 258 or more characters cannot run the voice engine at all
(Windows refuses such a working directory); it could not before either.
Voice dictation
Dictation is click-to-start / click-to-stop, then transcribe — not live. Streaming
ASR (words appearing while you speak) is explicitly out of scope (D30); the per-file
whisper CLI transcribes only a finished recording. The wait after stopping is the
whisper small model's real-time factor — on a short clip nearer RTF ≈ 0.5 (R-W3 measured
≈ 0.43–0.46 on short German benchmark clips; a long sustained file runs slower, ≈ 0.67 /
real-time÷1.5, see "Audio transcription" above), so a 15-second dictation takes a few
seconds to land. A warm whisper-server mode is the recorded
follow-up if dictation latency ever warrants it (D34's revisit clause).
The mic works only when the speech model is installed (the same
availability-driven gate as audio import — no settings key). Since #497 a drive without the
whisper binary + weights shows the mic greyed out instead of hiding it. A click explains what
is missing; since #527 that names the actual piece: the speech model, the voice engine, or
both. Its button opens the AI Model screen on the speech model (Browse, Voice), with the
voice-engine banner above it. Where this operating system has no voice-engine build the app
can install, the hint says dictation is not available here and offers no button.
Availability and its reason are read on entering the chat screen and on window focus.
Whisper, not the OS, decides what was said. Dictation quality is the small model's
(see "Audio transcription" above); the text always lands in the message box for review
and is never auto-sent — that review step is the accuracy backstop.
No interim cancel-without-transcribe control. Stopping the recording always
transcribes and inserts; deleting unwanted text is one Ctrl+Z / selection away
(the insert participates in the input's normal undo history). Leaving the screen
mid-recording discards the recording and releases the microphone.
One dictation at a time, and a wedged child can't hang the mic forever.
A second mic press while a dictation is still transcribing is
refused with friendly copy rather than spawning a concurrent whisper child. A child that
is still running past a 10-minute wall-clock ceiling (env-tunable; the recording is already
capped at ~35 min of audio) is killed and the composer gets the friendly failure instead of
a perpetual spinner.
A silent or near-silent recording is refused before whisper runs (#497). Whisper does not
return "nothing" for silence: the pinned build turns digital silence into the single word
you (under -l de: [Musik]) and low white noise into random-script text or broadcaster
credits (measured 2026-09-21 against the real binary + weights). The renderer therefore
measures the rendered audio and refuses a clip whose peak stays under −50 dBFS (or whose RMS
stays under −70 dBFS, or that is shorter than 300 ms) with "No sound reached the
microphone…" — the usual causes are a muted or wrong default input device, or the OS handing
a desktop app silence when its privacy settings do not allow the microphone. The main handler
re-checks the bytes as a backstop; only level figures go to the local log, never content.
While you record, the composer also shows a live "no sound is reaching the microphone" note
once the mic tap has stayed under the same floor for two seconds, so a dead input is visible
before you stop (it needs Web Audio; without it the post-stop refusal is the only signal).
Ordinary speech sits 40–50 dB above the floor (shared/dictation-level.ts records the
calibration). Beyond the gate, whisper runs Silero voice-activity detection first on every
dictation (#504): the VAD model (ggml-silero-v5.1.2.bin, MIT, under a megabyte) is the
speech model's second required file — fetched, verified and offered on the AI Model screen
together with the weight — and a recording with no speech in it, the noise band the level
gate cannot judge, comes back as "No speech was recognized" instead of a stray word
(measured 2026-09-21: digital silence and −40 / −30 dBFS white noise → zero segments in
half a second; a German sentence attenuated by 40 dB still verbatim, thanks to a 200 ms
speech pad that keeps quiet onsets — whisper.cpp's 30 ms default clipped the first word).
Audio imports still run without VAD: it remaps segment timestamps and audio citations
cite time ranges — unmeasured, so left as is. There is no input-device picker: the system
default microphone is used.
Scanned-PDF / photo OCR
OCR runs on the CPU at a couple of seconds per page (R-O3: ~1.3 s recognition +
~0.4 s rendering per A4 page on the reference CPU with the shipped best_int data).
That is exactly why it is never automatic for PDFs (D33): detection marks the
scan, the user starts "Make searchable (OCR)" deliberately, sees per-page progress,
and can cancel. A 200-page scanned book is a ~10-minute, user-chosen job.
Language coverage is German + English — the two shipped traineddata files. Other
languages will recognize poorly or not at all. Coverage is availability-driven (the
engine uses whatever ocr/*.traineddata.gz the drive carries), so a future language
is one vendored file away — but only deu+eng are pinned, reviewed, and tested.
Recognition quality is the scan's quality. Clean 150-DPI office scans came back
near-perfect in the R-O3 probes (103/104 words, umlauts/ß exact); a degraded ~80-DPI
JPEG still lost 3 of 104 words. The per-page text is searchable content, not a
notarized record — Preview shows exactly what was recognized.
Sideways and upside-down pages are turned upright only at right angles, and only with the
orientation data (#538). A page read with mean confidence under 75 gets an orientation check
(Tesseract OSD over ocr/osd.traineddata.gz) and is read again at the turn it names; the more
confident reading is kept. Limits: (a) without that file (a drive prepared before #538 that has
only the language files) pages are read as they come — the AI Model screen offers the file;
(b) OSD declines on very degraded or nearly empty pages ("too few characters"), which are then
read as they come; (c) only 90° steps are corrected — a slightly skewed page (a few degrees) is
read as it is; (d) a poor upright page pays one OSD run (0.15–0.7 s measured) on top of its
reading. A page that still reads poorly is counted as "unsure" (mean confidence under 65) and
named on the row and in the preview; the fallback for it is turning the page in a PDF viewer,
saving, and adding the saved copy (measured: a /Rotate saved upright reads 36 of 36 words).
"Unsure" is the recognizer's own confidence, not a check of the text. A poor but upright
photocopy and a page in a script the language files do not cover both score in the 50s; a
clean page about 92–94. The note says where to look; it cannot say which words are wrong.
A PDF with some scanned pages shows them after a Re-index if it was added before #575.
Scanned pages inside a text PDF (under 25 characters of text and painting an image) are found at
import. A PDF imported earlier carries no such record until it is parsed again. The check reads
only each image's declared size, never its data (1–2 ms per short page), bounded at 20 s per
document — pages it leaves unchecked count as scanned. A page whose text layer has fewer than 25
characters AND an image (a logo-only cover, a full-page figure) counts as scanned too; OCR then
reads what text the image holds.
The recognized text survives re-index; re-running OCR is the explicit redo.
Re-index (e.g. after an embedder switch) reuses the stored recognition rather than
silently re-OCRing for minutes; if the recognition itself was bad, run "Make
searchable (OCR)" again — it overwrites. This is a PDF-only guarantee: a photo's
recognition is never persisted separately from the document, so re-index re-runs it
from scratch (seconds) instead of reusing a stored reading, unlike a scanned PDF's
stored pages. Since #574 a photo keeps only the reading's counts (one page, its confidence,
the engine), rewritten by each re-index and cleared when it fails; its "Read again (OCR)" is a
re-index. A photo imported before #574 shows its OCR note after one re-index.
A cancel that lands during the final "Finishing…" step no longer stops the task.
Cancel works normally while pages are being read; once recognition is done and the
text is being persisted and re-indexed, a cancel click is deliberately ignored — the
row shows "Stopping if possible…" but the document completes and comes back
searchable anyway, because the recognition is already saved and the index rebuild is
already underway.
Photos are read on import (the D33 asymmetry — one image, seconds). A photo
import without the OCR files on the drive fails per-file with friendly copy; the row then
offers Download OCR files (#410), and Try again reads the photo once they are in place
(the stored failure text itself is unchanged — the remedy line is added at display time).
A single crafted/huge page can't wedge OCR for the session (backend audit
2026-06-27, REL-2). tesseract.js recognitions are serialized through one worker and a WASM
job isn't cooperatively cancellable, so a page that exceeds a 2-minute per-page ceiling
(env-tunable) — or a Cancel landing mid-page — terminates the worker (recreated lazily on
the next page) and fails that OCR task friendly; the engine recovers for the next document.
A second, fixed 60-second ceiling separately bounds each page's render step
(RASTER_STEP_TIMEOUT_MS, not env-tunable) — a slow-rendering page can fail the task at
60 s even when the 2-minute recognition ceiling would have allowed more time.
OCR walks at most the ingestion page cap (5 000 pages). A tiny PDF can declare an
enormous page count, so — mirroring the text parser's M-2 ceiling — the OCR page walk
clamps to pdfMaxPages (5 000 by default, HILBERTRAUM_PDF_MAX_PAGES). Progress, the
step total, and the persisted ocr_json.pageCount all report the clamped count (so
they stay truthful), and a truncation is logged locally. A genuine ≤5 000-page scan is
unaffected; beyond that, the tail of pages is not recognized.
OCR in a PACKAGED build: the crash is fixed and the packaging gap is closed (#232,
PRs #268 and #269); the end-to-end recognition smoke on a packaged build is still to be
recorded per platform. The defect (measured 2026-07-19 on a real packaged Windows build;
pre-existing and version-independent): worker_threads cannot load a script from inside
app.asar, so electron-builder.yml unpacks the tesseract packages and the engine rewrites
the resolved workerPath to app.asar.unpacked — but the worker's own hoisted dependencies
(regenerator-runtime, is-url, …) were not in that unpack list, stayed packed inside
app.asar, and could not be resolved from the unpacked directory. Before Phase 1 the
resulting worker load failure had no listener (tesseract.js sets the browser-only
worker.onerror, inert on a Node Worker) and reached the process as an uncaught exception
that killed it, while ocrAvailable still reported true beforehand. PR #268
(#232) made any such failure a per-document error: a packaged build proves the worker once
at startup (execution probe, released again on success) and reports OCR unavailable until
that proof passes — photos import and are stored without readable text, their row says "Text
recognition (OCR) could not run in this build …", "Make searchable (OCR)" is not offered, and
the Documents screen shows a banner saying the OCR files are on the drive but the recognizer
could not start; a re-index recognizes such a photo once OCR runs. PR #269 closed
the gap: tests/integration/asar-unpack-closure.test.ts derives the worker's require graph
and pins every module to an asarUnpack glob, and the missing packages are unpacked.
Measured 2026-09-02 on a packaged Windows build with the deu+eng language files: the
startup probe passes (ok: true, 277 ms) — worker script, hoisted deps, WASM core and language
init all load from app.asar.unpacked. What is NOT yet recorded is the interactive smoke on a
packaged build (import a photo, run "Make searchable (OCR)" on a scanned PDF; BUILD_STATE §5
item 18(c)) — the probe proves the load chain, that smoke proves recognition end to end; run it
per platform before certifying a kit for that platform. Dev mode was never affected — the
full raster → IPC → recognize pipeline was proven end to end on Electron 39 outside packaging.
Registered as follow-up 2 in architecture.md "Dependency remediation —
design record (wave DEP-1, PR #77)" §5.
The first question about a full-resolution image is SLOW on CPU. CPU prefill of a high-res
image is 52 s for ~2800 image tokens off USB (12 tok/s decode) — measured on b9585 (V1). The
client downscale-to-1536 px (renderer/images/decode.ts) is a real latency lever (fewer image
tokens ⇒ proportionally less prefill), and cache_prompt reuse means follow-up questions about
the same image skip the prefill — but the FIRST question per image pays it. GPU is the optimization
lever (§19.11) if CPU time-to-first-answer is unacceptable; MVP runs CPU-pinned (--device none).
RAM peak is co-resident, and the idle teardown bounds the window, NOT the active-use peak
(PROD-1). The vision sidecar is a SEPARATE llama-server (not the chat slot), so at peak you can
have chat + E5 embedder + vision = three processes. Vision peak 4.6 GB + a 12B chat (7 GB) +
the embedder ⇒ >16 GB — a 12 GB machine will likely OOM and even 16 GB is tight. The
recommended_min_ram_gb / RAM-best-fit gate keeps a vision model off machines that can't hold it;
the idle teardown (default 2 min) reclaims the ~4.6 GB once the user stops asking, but during active
use the peak stands. Vision is realistically co-resident only with a small chat model, or after
the chat sidecar idles out — not "12B chat + vision simultaneously" (model-benchmarks §8.4).
One image at a time; PNG/JPEG/WEBP in, PNG/JPEG shipped; HEIC unsupported (detected);
single-turn-thread per session; persisted but NOT searchable. The Images screen takes a
single image (no multi-image compare, no video, no camera). Format matrix (2026-08-09, #124):
PNG and JPEG are native; WEBP is accepted at intake and normalized in the renderer
(Chromium decodes it, the pipeline re-encodes to PNG), so the main-side analyze accept set and
the SEC-3/D4 header parsers stay PNG/JPEG-only — no new attacker-facing parser; the
original-bytes re-encode fallback is disabled for WEBP (those bytes would be rejected
main-side). HEIC/HEIF stays unsupported (no Chromium decode; a decoder would break the
no-new-native-dep rule) but is detected by extension with specific "convert to JPEG" copy.
A PDF is refused too, by extension or type (#539): its banner points a scanned PDF to Make
searchable (OCR) under Documents and offers Go to Documents; the PDF is not imported.
There is no fixed dimension reject any more (also 2026-08-09, #118): the renderer's old
post-decode 4096 px hard reject — which refused a routine 48 MP phone photo AFTER already
paying the decode — is gone; a pre-decode header prescreen (the same parse as main's D4
guard) refuses ~50 MP+ before decoding, everything decodable below that is downscaled to
1536 px as before, and the main-side 50 MP header cap remains authoritative. As of the
2026-06-20 change, an analyzed image and its Q&A turns are persisted automatically — the image
rows live in image_sessions/image_turns and the bytes rest encrypted at rest under the SAME
DocumentCipher as the document cache (workspace/images/<id><ext>.enc), browsable in an Images
history list and user-deletable (delete shreds the image + cascade-removes its turns). Since
2026-08-09 (#122) the list shows each entry's stored size and a total, a confirmed "Clear
history" removes everything in one action, and the images/ footprint appears in Settings →
Diagnostics beside free space — but there is no automatic retention/eviction cap: history
grows until the user deletes (a deliberate deferral, recorded on issue #122; each entry can be up
to ~20 MiB, and drive space is the scarce resource on this product). What is
still NOT true: this history is not added to the RAG/document corpus — it is a separate
browsable history, never indexed for retrieval/search — and there is no auto-OCR.
Image understanding is NOT OCR and NOT image generation. It reads/interprets one image with a
vision-language model; scanned documents still belong to Documents → "Make searchable (OCR)"
(tesseract.js), which is untouched. The Images screen never OCRs anything and never sends a file
to OCR on its own: it only points there (the OCR line under the drop zone, and the PDF banner's
Go to Documents button, #539), and the user starts OCR in Documents. The feature never
generates/edits images (a permanent non-goal).
Context is capped at 4096 tokens (vs the model's 128 000 train context) — fine for a single
image + a short question/thread in MVP; long multi-turn threads about one image are not a v1 promise.
imageReadBytes takes an opaque token, not a path (security-model.md D2).
imageChooseImage returns a one-time token; the absolute path stays in main, so the renderer
can't make main read an arbitrary file. The byte cap is re-checked on the open fd (no TOCTOU), and
the main-side guard also rejects decompression bombs by a decoded-pixel budget (D4).
No vision model ships on a commercial drive yet, but the sell gate already verifies BOTH files
(DIST-2).assertCommercialDrive → verifyDriveModels iterates the same manifestFiles set
(GGUF + mmproj) that computeInstallState requires, so a half-installed vision drive (good GGUF,
missing/corrupt projector) fails weightsVerified. The in-app DownloadManager now fetches both
files (GGUF + mmproj) as one job (DIST-1) — planModelDownloads plans the language GGUF then its
mmproj projector, the job's totalBytes/receivedBytes cover both, and a finish of a
half-installed vision model (GGUF already present, projector missing) fetches just the projector
(downloads.test.ts). The fetch-models.{sh,ps1} scripts remain the offline/CLI two-file path.
An evidence pack supports human review — it is not a certification. The pack records
what a human decided against the persisted sources; it does not (and cannot) prove the
answer correct, and it says so on its cover ("A citation shows where information came
from. It does not by itself prove that the answer is correct." / "This pack supports
human review; it is not a certification."). Treat it as a working paper for professional
judgment, not an attestation.
The pack reflects indexed/scanned content only. Excerpts, provenance and coverage
describe what THIS drive extracted and supplied to the model at answer time. Text the
extractor missed (bad OCR, unsupported regions, capped coverage) is invisible to both the
answer and the pack — the coverage section states the recorded breadth honestly, nothing
more.
Freshness compares stored hashes — it cannot see edits the workspace never learned
about. The Phase-4 freshness check (review open, export) compares the review's
snapshotted documents.sha256 against the CURRENT stored hash — deliberately no
re-hashing and no source-file reads (spec §21.2: cheap, offline, encrypted-workspace
safe). That means: a file edited OUTSIDE HilbertRaum shows as changed only after the
document is re-imported (imports mint new rows, so the old source usually reads
"missing" instead); a source whose stored hash is absent on either side reads "cannot be
verified", never a verdict. Unresolved-identity sources (legacy answers) are never
compared at all — the honest state is "cannot verify", not "changed".
Outdated means changed, not deleted. A source document that CHANGED under a review
flips the review to Outdated and export waits for an explicit acknowledge (spec §28.6);
a source that was DELETED marks that source "no longer present" with its persisted
excerpt retained, and export proceeds with the warning (spec §25.2/§28.7) — deletion is
an unavailability fact, not silent drift under the reviewed text. Acknowledging records
the CURRENT drift; if the drift changes again later, the warning honestly returns.
Source-in-context shows the stored extraction, not the file. The "Open source in
context" modal reads the text extracted at import (the chunks table) — never the
source file itself. If the document was re-imported or its stored text no longer
contains the persisted excerpt, the modal says the excerpt could not be located and
shows the persisted excerpt as recorded — it never approximates or re-reads.
The answer appears in the pack as plain text, not rendered markdown. Deliberate: a
main-process markdown-to-HTML renderer would be a second injection surface and a
determinism risk for the golden-tested template. The pack states the answer is reproduced
verbatim as frozen at review creation; formatting characters (#, *, backticks) show
as typed.
Pack language is frozen at generation. An exported pack is a snapshot in the pack
language chosen at export (English or German; English from any other interface language) —
switching the app language later does not (and must not) re-localize an existing file. The
stored SHA-256 pins the exact bytes.
No file paths, by construction. The review snapshot never captures paths, so no
export option can include one — the spec's "paths default off" is satisfied by absence.
PDF accessibility is best-effort — not a PDF/UA claim. The PDF export (P6) asks
Chromium for a tagged PDF with a document outline (generateTaggedPDF +
generateDocumentOutline), and the input HTML carries a strict semantic h1→h2→h3
heading tree — but Electron marks tagged-PDF generation experimental ("may not
adhere fully to PDF/UA and WCAG standards"), and this app cannot verify conformance.
What is verified (real-Electron smoke): the text is genuinely extractable/searchable,
the bookmark outline mirrors the heading tree, and the tagged (/MarkInfo Marked)
structure exists. If accessibility of the artifact matters, prefer the HTML pack — it
is the accessibility-first format (real DOM semantics, reflow, user styles). The PDF
states on its cover and Integrity section that it is a print of the same evidence-pack
template ("PDF — printed from the same evidence-pack template · pack schema v1") — one
template renders both formats by design; only that self-description line differs.
A destination very close to Windows' 260-character path limit can refuse an export
(post-AUD-17). Every export writes its temporary file as a SIBLING of the chosen destination,
named with a per-export token so two same-destination exports can never share a file
(AUD-17 closed a silent provenance swap). The token makes that name 37 characters longer than
the destination itself (4 pre-fix; a PDF export's print source added ~48 until #563, which
prints from memory and writes no such file), so on a default Windows setup
(LongPathsEnabled off) a destination within that margin of the 260-character limit fails at
the temporary file's creation. The failure is clean and honest — no destination file, no export row, a real
error — and the trade (an edge-case refusal vs. a silently mislabelled signed-off pack) is
deliberate. Recovery: save under a shorter path.
A review change whose save failed is still lost when you lock. If saving a decision or a note
fails (in practice a full or failing drive), the review keeps the change on screen with "Some
changes could not be saved yet." and Try again, Bulk actions waits, and opening another review
asks first — Try again, discard the changes, or go back (#837). Locking does not wait for it: Lock
now tries the save once more (giving up after about 6 seconds if the drive does not answer), then
locks, and an unsaved change is dropped with the rest of the review from memory. That is
deliberate — the lock is the user's security action and wins over a failing write, the posture
every lock path takes. Closing or quitting the app is different since #888: it saves first, with
the same bounded save (giving up after about 6 seconds), so a change made less than a second
before closing (the auto-save waits 600 ms) is kept, and so is a language just picked in Settings.
A change it cannot save asks first: Try again, Keep open, or Close anyway, which drops it. Two
exits still cannot wait for the window: a Windows shutdown, restart or log-off with the app open
(Windows ends the app; it locks at once, and a change not yet saved is lost), and a crash. A
reload of the window, which closes nothing and so saves nothing first, exists only in a
development build since #912 (View → Reload or Ctrl+R); the released app has no reload
shortcut or menu item. The error screen's own Reload button, shown after an unexpected error, still
reloads without that save.
Quitting (Ctrl+Q on Linux, ⌘Q on macOS) closes the hidden helper windows while the window still
saves, so an OCR run in progress stops at once and ends as cancelled, even when you then pick Keep
open; and an evidence-pack PDF export in progress is stopped by Ctrl+Q or ⌘Q itself (the print's
own before-quit hook), even when you then pick Keep open. Both can be started again. Nothing
new starts while such a quit waits: a document task waiting behind the OCR run stays waiting,
and goes on only if you pick Keep open (#936). On Windows and Linux, closing the window quits the
app (#910; before, the app went on running with no window and the workspace unlocked, and then
threw the finished OCR run away). While a scan is being read (OCR) or a document is being
translated, or one of them is waiting to start, the close asks first (#935): Keep open (the
default, and what Esc answers) leaves everything as it was, and Close anyway stops them the
way quitting does; run again, they start over from the beginning. The question does not come for
Ctrl+Q or ⌘Q, which stop them at once (one pressed while the question is up closes it and counts
as Close anyway), for Lock now, for the macOS red button (the app and its tasks keep running), or
for a PDF export, a deep index, a summary or a comparison alone: closing during a PDF export
still stops it the way quitting does, and a deep index, built again, reuses the parts it had
already built. While the question is up, the workspace stays unlocked: a close
followed by walking away no longer locks within seconds, but only once someone answers (there is
deliberately no timer that answers for you), unless a quit arrives meanwhile (Ctrl+Q or ⌘Q):
that closes the question and the app quits as if Close anyway had been picked. On Linux a
log-out, a shutdown or a kill meanwhile, and on macOS a kill, a launchctl stop or a forced
restart, locks the workspace at once and ends the app, without the question and without the
save (#964, #977). On macOS, a log-out or shutdown with the
app open may be interrupted once while the window saves: the order of the system's quit and its
shutdown event is unverified (#226). Owed checks on a Mac: the red button, ⌘Q (also during a PDF
export), a Dock click during an OCR run (it should bring the window back, #910), and a log-out or
shutdown with the app open.
All of these are decided scope, not oversights; the design record's §7 carries the reasoning.
v1 serves chat completions and a one-model listing — nothing else. No embeddings, vision,
transcription, or translation route, and no way to start/stop/switch a model from outside. The
endpoint borrows the model the user already started; if none is running, callers get
model_not_loaded until a human acts.
No tool/function calling, no image or audio content parts, no n > 1. These are refused by
name (400 unsupported_field) rather than silently ignored, so a client fails loudly at setup
instead of quietly getting a degraded answer.
Sampling extras are accepted and ignored (top_p, stop, penalties, seed, …).
RuntimeChatOptions carries no such fields; extending the runtime contract mid-wave was
rejected in favour of documenting the omission. Honoured today: max_tokens (clamped to the
context window), temperature, and response_format.json_schema.
usage token counts are absent from responses. The streaming reader discards them, so
surfacing them means extending the runtime contract; documented-as-absent beats fabricated
numbers. A post-v1 candidate — clients that require usage accounting will not work.
One outside request generates at a time (plus one waiter, ~30 s cap), and in-app use
pre-empts it. A deeper queue on ~2 tok/s CPU hardware is a silent multi-minute hang, so the
refusal is fast and explicit (429 + Retry-After) instead.
No per-connection visibility — the card shows counts only. Naming who connected and what
they asked would require keeping exactly the record the feature promises never to keep.
A loopback endpoint cannot distinguish one local program from another. The access key is a
boundary against casual use by other programs, not against code already running with the user's
rights; a same-user debugger can read it out of the unlocked workspace. Recorded in
security-model.md and ../SECURITY.md.
The pinned sidecar build leaves /health auth-exempt on its own port, so a local process can
read liveness ({"status":"ok"}) — upstream behaviour, unrelated to the app's own endpoint but
part of the same threat surface. On b9849 /v1/models was exempt too and exposed the loaded
model's file path (metadata, never content); since b11146 it answers 401 without the key
(#512; unchanged on the b12110 pin, #729). A drive still on b9849 keeps the wider exemption until
its engine is updated (the AI Model screen offers it, #516).
The interface comes in ten languages, but the app understands questions best in English and
German. English, German, Spanish, French, Italian, Dutch, Polish, Turkish, Russian and
Ukrainian are offered under Settings → General → Language. You can ask questions in any of
them, but the rules that decide how a question is answered — whether it asks for a complete
list, which notes lead the answer, when a skill is suggested or started, and how a knowledge
pack is searched — recognise English and German wording only. Two kinds of message are
recognised in all ten languages: the document chat's two example questions ("Summarize this
document" and "Find every mention of …", also with your own word in the quotes), and short
greetings, thanks and goodbyes ("Gracias", "Dziękuję!", "Teşekkürler!", "Дякую!"). With two
documents in the chat, the French words for a difference ("différence", "différent",
"diffère") also ask for a comparison. Cases you can run into: a summary of a document too long
to read whole, asked in your own words, such as the French "Résume ce document", is answered
from the most relevant passages even when the document has a deep index, while the example
question "Résumez ce document" uses the deep index, like "Summarize this document" (a document
short enough to read at once is read whole either way); the Italian "alle" ("at the") and the
Dutch "alle" are read as the German "alle", and the Polish "list" ("letter") as the English
"list", so a question such as "Alle ore 10 cosa succede?" or "Kto musi podpisać list?" can get
the heads-up that the answer may miss items; in a chat about one document, a thank-you longer
than the app's short lists, such as "Gracias por todo" or "Спасибо за помощь", is taken for a
question about it and can start a read of the whole document; and the knowledge-pack search
counts the Spanish word "es", the French "des" and the Dutch "wie", "was", "die" and "man" as
German words, so it can take a Spanish, French or Dutch question for German ("Wie is de man op
de foto?" counts as German).
Only the English and German interface has been reviewed by native speakers. The Spanish,
French, Italian, Dutch, Polish, Turkish, Russian and Ukrainian text was machine-translated and
checked by a second AI model; no native speaker has reviewed it yet. The app shows no notice
about this. If one of these is your native language and you'd like to review it,
CONTRIBUTING "Reviewing a translation" says how.
Text recognition (OCR) reads German and English; speech was not tested in the new
languages. The OCR files the app installs cover German and English only, none of the other
interface languages (#810), so a scan or photo in another language may be read with errors.
Dictation and audio import detect the spoken language on their own; how well that works in
Spanish, French, Italian, Dutch, Polish, Turkish, Russian or Ukrainian has not been measured.
Evidence packs are written in English or German. From any other interface language
(Spanish, French, Italian, Dutch, Polish, Turkish, Russian or Ukrainian) the pack is written in
English, and the export panel says so. The answer inside the pack is quoted as it was written,
and so are the notes the app puts in front of a document answer (for example "I answered from
… only" or the heads-up that a total is the model's own arithmetic), which are written in the
interface language of the moment: an English pack exported from a French interface can quote
French lines.
Spanish figures use the Spain number format for every Spanish-speaking user: a full stop
between thousands and a decimal comma (98.304, 4,3 GB), which readers used to the Mexican or US
format can misread.
Dutch dates use the Netherlands pattern for every Dutch-speaking user, in Belgium too:
13-11-2026, not the Belgian 13/11/2026.
Figures in a skill's answer are written with a dot in every language. The invoice and
bank-statement answers quote the amounts they read with a decimal point ("5.50 EUR"), whatever
the interface language, and the tax rate in an invoice answer is written the same way, so a
German answer reads "Steuer (5.5 %)" rather than "5,5 %".
One text still ignores the language's own way of writing it. In Settings → Diagnostics →
Activity, every entry is written "time — type: message", with a dash that Spanish, French,
Italian, Dutch, Polish and Turkish don't use there.
A model with no checksum on record is still called damaged outside the AI Model screen. A
model whose manifest has a placeholder hash instead of a real checksum (a model you added yourself
before capturing its hash) is refused at every start unless developer mode is on and the drive's
policy allows unverified models. The AI Model screen says "No checksum" for it, and the Performance
screen "no checksum on record". The Images and Translate screens still say that its file failed its
check and should be downloaded again. So does the app's log when it refuses to start such a chat
model on its own (at unlock, or after the AI engine is installed or checked again); no screen offers
to start it. The document search says to check all model files and try again. None of this can
help: such a model needs a real checksum in its manifest.
The speed line under an answer can read "1 tokens". In English, the line under a finished
chat answer ("42 tok/s · 1.8 s to first token · 615 tokens") ends in "1 tokens" after a
one-token answer. The other count sentences that read wrong at exactly 1 in English and German
were fixed; this one was left as it is.
With a Turkish interface, words shown in capitals follow Turkish rules, your own text
included. Some labels are shown in capital letters (section titles, the date groups and
project names in the conversation list, the section headings in a document's preview). In a
Turkish interface they are capitalised the Turkish way, where a dotted "i" becomes "İ": that is
right for Turkish words, but a project you named in English, or a document's own English
heading, changes too ("Overview" reads "OVERVİEW"). The app can't know which language your own
text is in. The lock screen's "HilbertRaum Lite" keeps its spelling.
Search finds the Turkish dotless "ı" only when you type it, whatever the interface
language. In conversation search and the keyword part of document search, a word typed with
"ı" finds it in small letters and in capitals ("ısı" finds "ısı", "Isı" and "ISI"), and a word
typed with the capital "İ" finds the same word in small letters and in capitals ("İstanbul"
finds "İSTANBUL", "İstanbul" and "istanbul", and no unrelated "I think …"). Search never adds
an "ı" you didn't type, though: "isi", "Isı" or "ISI" typed doesn't find text written "ısı",
and "kir" doesn't find "kır", while "kır" finds "kir". To find every form, type the word in
small letters with "ı" where it belongs. Search looks for at most 32 words and spellings in
all, the words you typed first, so in a very long search the extra spellings can be left out.
Document search also compares meaning, which this doesn't affect, so a passage can still be
found that way. The filters on screen (the Documents name filter, the AI Model search and the
review's evidence filter) match I, ı, İ and i every way round.
Search can't find a Cyrillic word stored with a separate accent mark. Most keyboards type
an accented letter such as "é", "ş" or "й" as one character, but text from some Mac and Linux
sources can hold the base letter followed by a separate accent mark, and the two look the
same. Whichever way you type such a letter, the filters on screen and search take it as the
one letter, and the filters also find a name stored either way (macOS stores file names with
separate marks). Search has one gap: when a document or message holds a Cyrillic letter with a
separate mark, such as "й" written as "и" followed by a separate breve, search drops the mark
and records that word with a plain "и", so neither "й" typed as one character nor "й" typed
with a separate mark finds it. Typing the letter without its mark ("и" for "й") does find it.
Latin letters don't have this gap, because search ignores their accents either way: "résumé"
is found however it was stored or typed. Document search also compares meaning, so such a
passage can still be found that way.
Two app versions on one computer can show the lock screen in another language. The
language you choose is stored in the workspace, but the lock screen's language is remembered by
the computer. When an older HilbertRaum version opens a workspace set to a language it doesn't
offer (for example Русский), it treats the setting as System: it uses the language its
System choice gives and remembers that language for the lock screen. The newer version's next
lock screen is then in that language until you unlock. In Settings, version 0.1.65 and earlier
show no language as selected; pick the one you want. A later version that meets a language it
doesn't know shows System in its list with no language chosen, and saves nothing until you
choose one; choosing System there saves System.
Copy reports for support come in the interface language, with an English copy. The reports
the Copy buttons make (Settings → Diagnostics, the Performance screen) are written in the
language the app is shown in. In any interface language but English and German, the same paste
then holds a line "--- English ---" and the same report in English, so a report from a Russian
interface is in Russian and in English. An English or German interface copies one report.
Task/summary output language follows the model, not the UI (D-L6 — RESOLVED as
documented). LLM prompts are pinned English (benchmark comparability; models
follow the language of the user's question naturally), so a one-click summary of a German
document may come back in English depending on the model. Making task-output language
explicit is a separate future feature — it belongs with the existing
TranslationTargetLang machinery, not with UI i18n.
Audit-log messages and the activity export stay English.runtime_events.message is
written and exported as-is (the export is a diagnostic artifact); only the friendly TYPE
labels in the Diagnostics Activity panel are translated. Per the audit-log privacy rule the
messages carry ids/filenames/counts, never content — a stable English diagnostic record was
chosen over translated DB rows.
Library-origin and other unmapped error strings are shown as written, usually in English.
The D-L4 display map covers the finite persist-canonical set (exact match, plus five
interpolated messages matched by their template), so anything else in
documents.error_message, such as a raw parser-library error (a pdfjs exception message), is
shown as it was written. A line in the interface language stands above it: "This file couldn't
be processed." on a failed document's row, and "Couldn't add report.pdf to this chat." (with
the file's name) in the chat's banner for a failed attachment, and the file translation's banner
says the same as the row for the same file. Other failures read the same way, with the
message after a line in the interface language: a review's save line ("Some changes could not be
saved yet." then, for example, SQLite's "database is locked"), a review that could not be opened,
and a failed evidence-pack export ("The evidence pack export did not finish." then, for example,
a file write error). Wherever a screen reports that one of its own actions failed, though, the
failed call's own message still shows on its own: on the Documents, Chat, AI Model and
Performance screens, in the knowledge-pack panel and the OCR and knowledge-pack tool installs, in
the preview and article windows, for dictation, and on the Translate screen when a call itself
fails (starting the translation, reading the result) rather than the file. That message is
usually the app's own words in the interface language, but a database or file error reads as the
system wrote it (for example "database is locked"). A rare failure-path remnant, accepted.
user-guide.md, READ ME FIRST.txt, and the drive docs are English-only for now, whatever
the interface language. Translating them is content work, tracked separately from UI i18n.
A conversation transcript can legitimately mix languages. Old answers, model output,
and the fixed RAG answers translate (or don't) independently of the current UI language —
accepted.
What the AI engine needs from the system (#530 — architecture.md "Engine load failures")
On Linux, a 2022-era distribution or newer. The pinned llama.cpp and whisper.cpp Linux
builds need glibc 2.34, GCC 12's libstdc++ (GLIBCXX_3.4.30) and, for llama-server, OpenSSL 3,
which means Ubuntu 22.04, Debian 12 or Fedora 36 and newer. Electron's own floor (Ubuntu
18.04+) is lower and does not apply to the engine. These floors come from the pinned builds;
re-read them on every engine pin bump (model-policy.md "To bump").
libgomp is taken from the system, not bundled (owner decision 2026-10-01). Every Linux engine
build links libgomp.so.1. Desktop images ship libgomp1: Ubuntu Desktop 22.04.5 / 24.04.3 /
24.04.4 and every Debian 13.7 live flavour were checked. Minimal, server, WSL and container
installs may lack it, and then the app names the library and the package. Bundling is
reopened only if real users report the problem; the facts for that case are on the #530
comment.
On Windows, the Visual C++ runtime is taken from the system, not bundled. Every Windows
engine build (llama.cpp, whisper.cpp, kiwix-tools) imports msvcp140.dll, vcruntime140.dll
and vcruntime140_1.dll, and no drive folder carries them. Most PCs have the Redistributable
through other programs, but it is not part of Windows. Whether a stock Windows 10/11
installation carries it was not measured. A missing DLL exits 0xC0000135 with no message, so
the app checks System32 for the three files to tell this case from damaged engine files. That
check is presence-only: an outdated Redistributable with the files present reads as "damaged
engine files", and the troubleshooting entry covers both causes.
On Windows 10 before version 1903, a drive path with unusual characters may not reach the engine
(#729, expected, not measured). Since the b12110 pin the engine's programs take their command
line as UTF-8 through an application manifest, and llama.cpp no longer rebuilds it from Windows'
own wide-character copy. Windows reads that manifest from Windows 10 1903 on. On an older build,
such as Windows 10 LTSC 2019 (1809), a model path with characters outside the system's code page
(Japanese folder names on a German Windows, say) would arrive mangled and the model would not load.
German umlauts on a German Windows stay inside its code page. Measured on Windows 11 only: a model
and an mmproj under pfad äöü 日本 [1] load on b12110.
A refusal is a session verdict. It is not stored, and a restart or Check again re-tests
it. Check again re-starts only the engines that have a verdict; it does not install anything.
When the refused program later starts on its own (an intermittent Smart App Control block), its
verdict clears itself.
On Linux and macOS, a program that cannot even be spawned is not classified. Example: a drive
mounted noexec, where the error is EACCES. It keeps the old "failed to launch" handling, now
without the path in its message. A drive the app itself runs from is not mounted noexec.
Knowledge packs keep their old wording for this case. kiwix-tools is static on Linux and
macOS, which makes it immune there. On Windows it imports the Visual C++ runtime like the
engines, and a refusal there still reads "search error" (chat) or "the archive could not be
read" (Add packs…). This is out of #530's scope.
macOS is classified from dyld's documented wording; it has not been measured on a Mac.
Old records keep what they recorded. Activity-log (audit) entries written before #530
can hold a raw loader line with the drive path; they are append-only and stay as they are. New
code writes none. Failed document rows and the GPU flags are cleaned at the next session start.
An audio row that failed before #530 cannot be told apart from any other transcription failure,
so it keeps its old text.
The in-app reinstall needs a download (#532). "Install the AI engine again" fetches the
pinned build. On a drive whose policy forbids downloads (an offline Kit) the button stays
disabled and the troubleshooting entry is the path; an offline repair would come with the
signed update bundles (Phase 22). It re-fetches what the operating system refused: the main
build, the cpu/ safety net, or both (#678). A cpu/ net the drive's pinned sources have no
build for (a main folder replaced by hand with the processor build) cannot be replaced in the app.
No reinstall while the engine's cpu/ build answers. When the main engine folder is
damaged but its cpu/ build runs the model (a Windows Kit), the reinstall still asks to stop
the model first: the app cannot tell that runtime from the main build running on the
processor.
Engine updates (#516) can cut off a quick translation. The update waits for answers (in the
app and through the local API), imports, article saves, document translations, image questions
and document tasks, but a quick translation on the Translate screen that is in flight at the
moment the models pause is cut off and has to be asked again. The pause lasts a few seconds. An engine without a version record is never offered an update, and the
knowledge-pack tools are only reported. On an offline Kit the update waits for the signed
update bundles (Phase 22); until then the scripts update the drive.
A second refusal of a fresh copy is not a damaged copy. If the copy the app just installed
is refused as damaged too, the banner says its files are probably not the cause (on Windows,
usually an outdated Visual C++ Redistributable) and offers no second reinstall. That marker
lasts until the app restarts.
Integrated GPUs (Intel Iris Xe / UHD, AMD APU "Radeon Graphics") gain little. They share
system RAM, so token generation is often near CPU speed (~1–2×); prompt processing improves
more (2–4×). This is honest physics, not a bug — the app still uses them automatically when
the driver is stable, but the hardware-profile bump deliberately ignores them so the model
recommendation stays RAM-based. Hybrid laptop case (PR #308 audit, 2026-09-06): the same
reasoning extends to a laptop with BOTH an integrated and a discrete GPU — the picker's budget
device is the largest device that is not integrated by name (selectBudgetDevice), so the
recommendation and the "Your model" fit estimate are judged against the discrete card only,
never the iGPU's shared-RAM figure. The runtime agrees, measured 2026-09-07 (#318 leg 5,
issue #320): llama.cpp's --fit drops the integrated device by TYPE before it fills devices, so
the sidecar puts every buffer on the discrete card even where the driver lists the iGPU first —
the app passes no --device and does not need to (docs/architecture.md "GPU acceleration"
runtime record). Not measured: an Intel-first hybrid, of which the project has none; the
exclusion is by device type, so it is expected to carry over.
Vulkan slower than CPU is possible on weak-iGPU + fast-CPU machines. v1 does not
auto-benchmark CPU vs GPU and pick a winner (decided, GPU record §1); the Settings
"Use GPU acceleration" toggle covers that case.
win/arm64 and mac/x64 ship no sidecar build (decided, GPU record §1). mac/x64 = Intel
Macs: upstream builds them with Metal off and macOS has no Vulkan, so GPU acceleration is
impossible there regardless; Apple discontinued the line in 2023.
Intel Macs are not supported by prepared drives at all (pre-existing gap surfaced while
planning the GPU work, not introduced by it): a drive's mac/ dir holds an arm64 binary
that exists but cannot execute on x64, so the runtime selector picks the real backend and
start() fails with a spawn error instead of falling back to the mock — and the fallback
ladder's rungs 2–3 reuse the same wrong-arch binary. A DIY Intel-Mac user could drop a
self-built x64 llama-server into runtime/llama.cpp/mac/; prepared drives do not.
A model the runtime cannot load no longer disables GPU (issue #312, fixed 2026-09-07). The
rung-1 failure is held until the forced-CPU rungs answer: one of them starting persists
gpuAutoDisabled as before, while every rung dying the same way blames the model — nothing is
persisted, and the user gets a notice naming the model plus the rung-4 mock's disclosed
simulated replies (architecture.md §5.2). Until #515 (2026-09-27) the "same way" comparison read
the last log line, which never carried the error (a per-process timestamp, or on Windows a bare
colour reset), so where the log is uncoloured (macOS/Linux, by llama.cpp's own terminal check) a
model fault still disabled GPU, and on Windows two different
failures with the same exit code counted as one; it now compares the first error line with the
timestamp stripped, and the sidecars log without colour. Since issue #372 (2026-09-07) the model is also named
when acceleration is off or auto-disabled (no GPU rung to compare against), and a blamed model
is latched for the session: its next start spawns no rung and lands on the notice + the
mock at once instead of paying up to three 180 s health timeouts again. Residuals: (a) the
latch is session-scoped and cause-blind — a transient cause on every rung (RAM pressure from
another program, a full temp disk) latches the model like a corrupt weight does; the retry
paths are "Verify checksum" on the model, a re-download of it, a chat-engine install, or an
app restart — "Try GPU again" is deliberately not one of them; (b) the health-timeout path
is classified conservatively — the tail of a child that never became healthy is arbitrary, so
with a GPU rung those failures usually differ in class and stay a device verdict (without one,
the timeout class still latches); (c) mixed-cause failures still latch the GPU: a genuine
device fault whose CPU rungs fail for an unrelated reason (the Intel-Mac wrong-arch binary
above) is blamed on the device, which is the deliberate conservative default. Diagnostics →
"Try GPU again" still clears the flag in one click.
The probe labels; the ladder guarantees.--list-devices proves enumeration, not stable
inference — a driver can enumerate fine and crash on the first compute submit. That case is
handled by the crash auto-fallback (one CPU restart + a friendly notice); the in-flight reply
is lost, same as today's crash handling.
Performance screen and per-computer history (PR #303 audit)
Identical hardware collides on one key. Two computers with the same CPU model, core count,
RAM rounded to whole GB, OS and architecture share one machineKey: their results overwrite
each other, and the twin never appears under "Other computers."
The RAM-rounding boundary can split one machine into two.ramGb is already rounded to
0.1 GB by detectSystem; the key rounds again to whole GB, so a BIOS or iGPU
memory-reservation change that moves a machine across a whole-GB boundary reads as a different
computer.
An OS or architecture change splits a machine too — a dual-boot switch or a 32→64-bit
reinstall reads as a new computer, not the same one.
GPU, driver/backend, context size and USB port are not part of the key. A stored result can
be stale for any of these without the app treating the machine as new.
gpuAutoDisabled travels with the workspace, not the machine. The auto-disable flag (and
gpuLastError) is a plain workspace setting with no machineKey stamp, unlike gpuProbe: a
GPU failure persisted on one computer keeps the next computer on the CPU rung until "Try GPU
again". Seen as a risk in the #330 round trip (the flag was never set there).
The unlock-time device probe could lose a race with the auto-start — FIXED 2026-09-08
(#380).prepareFirstBenchmark used to fire the session's one --list-devices probe in the
same tick as the active model's auto-start. Under the concurrent weight upload the probe took
7.7 s against its 10 s bound on an RTX 3080 Ti (#330 round trip,
eval/results/hardware/330-round-trip-20260907/probe-race.txt), and a timed-out probe was
cached as "no GPU" for the session: the graphics tile read "None", the recommendation fell to
the RAM basis and the start was labelled cpu while the model actually ran on the card. Now:
the auto-start waits for the session probe (about 1 s on an idle driver, and nothing at all on
a machine with no llama-server — the probe is never called then); a probe that hits the bound
answers "unknown" and is neither cached nor persisted, so the stored probe stands until the
next start or check, and "Try GPU again" re-probes; and a start whose probe is unknown takes
its backend label from the load log instead of defaulting to cpu, naming the device the
start's own compute buffers landed on. (It read the offload line until #653, which a PC with no
usable card prints as offloaded 37/37 layers to GPU too; it reads GPU buffers now.) A workspace with no stored result is
sequenced the same way since #473 (2026-10-07). It used to fire no probe and let the ladder's
own probe run beside the upload, on the reasoning that a timeout there answers "unknown" and
the measurement behind the start re-probes on an idle driver — true only for a TIMEOUT: a probe
that answered mid-upload was cached and persisted as the session's baseline with the chat model
already on the card, where the reranker gate then subtracted chat a second time. Residuals: a genuinely
wedged driver still waits, once per session before the auto-start, the probe's 10 s bound plus
the one-time sidecar-binary verification, which the start itself would wait on anyway; and
"Try GPU again" against a still-wedged driver shows no change once the bound elapses — the
unknown answer writes and pushes nothing, and the button has no busy state of its own.
A crashed device probe labelled a card start CPU for the whole session — FIXED 2026-10-13
(#653). A --list-devices child that crashed (a Vulkan driver dying during enumeration) or
could not be spawned answered "no graphics card". The session kept that answer and it overwrote
the stored probe, and it outranked the start's own load log. The chat header and Diagnostics said
CPU while the model ran on the card, the Performance screen judged against RAM, and a GPU crash
restarted on the same card and then stopped the model instead of falling back to the processor.
Now such a probe gives no answer (the stored probe stands), and a start whose log put buffers on
a card is labelled GPU from that log. Residuals:
an answer of "no device" that the server contradicts (an enumeration race) labels the start
right, but the empty answer stays the session's (and the stored one) until "Try GPU again" or
the next session;
a drive that has never stored a probe still shows no card while every probe crashes;
a probe that crashes every time costs one short crashing child per start or check (two for a
model with the speculative-decoding rung);
like a timed-out one, a crashed probe at unlock leaves the model start's own probe to run beside
the weight upload, and an answer there is stored with the chat model already on the card
(harmless on NVIDIA/Windows, whose free figure does not move);
a transient read failure while the packaged app hashes the engine still reads "no graphics card"
for the session (the integrity check reports it as a mismatch).
A USB bus reset while unlocked drops the decrypted working copy's WAL. exFAT reported a
lost delayed write on workspace/hilbertraum.sqlite-wal after a UASP device reset (#330 round
trip); the restore that session had written was gone, the next unlock restored again, and
the seal at lock carried the state into the .enc. Run chkdsk /f on the drive after such
an event.
Unknown identity stays eligible as "this machine" (G3). A legacy record with no identity, or
one where hardware detection failed, is treated as compatible with whatever computer is running
now — a compatibility policy, not proof the data actually describes it.
A value misattributed before this fix is corrected only by a fresh check on that computer.
The app cannot retroactively distinguish an old mixed-identity record from a genuine one; it can
only replace it going forward.
One placement record per model per DRIVE, not per computer.modelPlacements keeps a
single entry per model id: starting that model on another computer replaces the entry, and back
on the first computer the "Your model" row shows the estimate again until the model starts
there once more. Entries are never pruned when a model is uninstalled; the only bound is the
256 KB JSON-string cap on the whole settings blob.
An integrated GPU's shared memory is never graphics memory. The Graphics memory tile and
the memory-class estimate both treat an integrated chip's reported memory as shared system RAM,
never as a usable VRAM budget, however large the reported number.
The observed rows are app-lifetime latches, not a log. They survive a workspace lock/unlock
and are cleared only by an app restart, and only a finished chat answer latches — a local-API
answer never passes through the chat observer, so it never appears there.
The moved-drive re-check repeats at every unlock, not indefinitely within one session. A key
mismatch schedules exactly one automatic attempt per unlock: a machine where the check keeps
failing (no compatible runtime binary, a drive-probe error) retries at the next unlock rather
than looping in the same session, and a manual Check again always ends the re-check
immediately.
A model start that never settles defers the automatic check to the next launch instead of
waiting indefinitely or measuring an unfinished load.
A manual (non-automatic) model start already in flight is not awaited by the scheduler. Only
the automatic auto-start is sequenced ahead of the benchmark. Measured 2026-09-08 (#334,
eval/results/hardware/334-slow-usb-20260908/): a Models-screen visit during the auto-start
hashes beside it (the 9B hash 65 → 213 s, the load 91 → 132 s), and a "Use model" press seconds
after the start settled stopped the auto-started model under the check's speed leg (the run
ended in 3.4 s). The persisted profile and ★ were unchanged; only that run's speed figure is
absent or chunk-based. FIXED 2026-09-08 (#393): the speed leg's busy re-check also watches a
start in flight (startingModelId, set synchronously before the queued start stops the running
model) and whether the manager still holds the runtime the leg captured — so a start that
COMPLETED between the capture and the leg is caught too — and a stream cut by that stop raises
the same "speed skipped" warning instead of a silent missing figure. What remains is the start's
own pre-start hash (before RuntimeManager.start is called): invisible to every signal, but it
only slows the check by drive contention, it stops nothing. A start that WEDGES leaves
startingModelId set for the session, so every automatic check that session skips its speed
leg — a model that never finishes loading is unmeasurable anyway, and the warning says so.
A model started right after a Models-screen visit persisted the page cache as the drive's read
figure (issue #392, fixed 2026-09-08). The #108 guard suppressed the load sample only when the
START's own install check hashed the file; when the Models screen hashed it moments earlier the
start hit the cache, the prefetch read RAM, and the model-load sample (589 MB/s for a 28 MB/s
stick, #334 leg B1) outranked the honest checksum sample for good — so the 100 MB/s slow-read
warning never fired on that machine and the next-start estimate stayed optimistic. This is the
default first-run journey (#382 hashes everything before a model can be chosen). read-speed.ts
now remembers the absolute paths a checksum sample was recorded for in this process and drops
a load sample over any of them, whoever hashed them — the honest checksum figure stays the
headline. (The premise "this is the default first-run journey" was true when written: #382 then
hashed everything before a model could be chosen. Since #382 the screen verifies lazily, so the
first-run path usually hashes on the start itself and the one-shot flag covers it — the
warmed-path set still earns its keep for "Check all model files", a background verify and any
later start of a weight hashed earlier in the session.) The #114 prefetch skip is deliberately
NOT widened (it stays on the start's own hash):
the −49 % cold-start win is not traded for a data-quality guard. A start right after an in-app
download now records no read sample at all: the download verify is excluded from sampling by
design (it reads bytes the app just wrote) and the page-cache-warm load after it is dropped too
— honest absence rather than a wrong figure, and the next cold start records the medium.
Both residuals of the original fix — the warm relaunch re-persisting a page-cache figure, and a
machine that already carried one keeping it — were closed by #404 (below).
A warm relaunch used to re-persist a page-cache read figure over the honest checksum sample
(issue #404, fixed 2026-09-08). Nothing hashes on a relaunch — the checksum store answers from
(size, mtime) — so #392's warmed-path set is empty and the auto-start's load window times the
OS page cache. preferCandidate let a model_load sample beat a checksum incumbent
unconditionally, so that page-cache figure displaced the honest one on both destinations and
took the 100 MB/s slow-read warning with it, every launch, for as long as the drive stayed slow.
The rule is now amended in both directions for a media-bound checksum sample — one below
SLOW_READ_MBPS (100), which cannot be hash-CPU-bound because the measured SHA-256 floor is
~136 MB/s (benchmark.md, "Slow read"): such a candidate may displace a model_load
incumbent (repairing a machine that already carries an inflated figure), and symmetrically a
model_load candidate does not displace it (stopping the oscillation). Strict <, so a
sample at exactly 100 MB/s keeps the old ranking. preferCandidate stays the single ranking
rule; its four call sites all follow. Accepted failure mode: move the drive to a FASTER USB
port on the same machine — the port is not part of machineKey — and the slow figure stands
until something hashes again. It self-heals: a newer checksum sample still beats a checksum
incumbent, and since #382 every new model pick hashes at the start gate.
The Home screen's launch preflight writes its 8 MiB probe at unlock, in the same second the
auto-start begins hashing (#334 perf marks, 0.4 s after unlock_done). It persists nothing and
measured the same write figure as the sequenced probe after the load; noted, not sequenced.
One performance:get read costs about 27 ms on the drive (a synchronous manifest scan
alongside settings and system detection), and about 90 ms once per session on a cold cache —
measured on real removable media 2026-09-09, accepted as-is, no cache built (issue #333,
closed; figures and reasoning in benchmark.md §4 I5). The earlier "~100 ms" figure was taken
on the reviewing machine's internal disk, while the launchers point HILBERTRAUM_MANIFESTS_DIR
at the drive's own copy. Of the 27 ms, only 18 ms is the scan and 82 % of that is YAML
parse + validation — CPU that a faster drive does not move — so the screen stays honest about
what it costs: a cache could have removed 18 ms of it, on a screen that is pushed rather than
polled. What a slow drive does affect is the cold read, and there the cost is per-open
latency, so a catalog's file count matters more than its size.
The silent re-check has no Home-screen notice yet. The moved-drive re-check above runs with
no visible sign beyond Performance itself refreshing; a Home notice while it is pending is
tracked in BUILD_STATE §5 item 22 (a).
Nothing on this screen was announced to a screen reader — FIXED 2026-09-10, by-ear
re-verification outstanding (found by ear with Narrator on 2026-09-09, issue #331, against a
positive control proving live regions do work in the app's window). Two separate defects: the
progress-step list was inserted already containing its content AND carried progress only in a
CSS class and an aria-hidden icon, so a check was silent from start to finish (#437); and the
failure banner was silent too (#436) — not specific to this screen, see the Accessibility entry.
The step list is now mounted unconditionally (.perf-steps:empty keeps the idle layout) and
every step carries its state in its accessible text (an aria-hidden visible label plus an
sr-only ": " twin, so an advance is a whole-line text change) with
aria-current="step" on the active item. Pinned by PerformanceScreen.test.tsx describe
"the step list is announceable (#437)". What is pinned is the DOM, not the sound: both
issues ask for re-verification by ear during a real multi-second check, and that still needs a
screen reader on the hardware box.
An automatic check reports itself in one line, not as steps — FIXED 2026-09-12 (#438). A
first-run or moved-drive check is run by the main process, and progress steps are addressed only
to the window that invoked benchmark:run — but the screen used to render the step list
whenever the backend span was held (correct per audit M1), so a moved-drive check sat frozen on
step 1 for its whole duration (measured: 13.7 s) and then disappeared. Both halves were
deliberate; the frozen list was their product. The step list now belongs to a run THIS window
started; any other run — first-run, moved-drive, another window — gets one line, "Checking this
computer in the background.", in the same live region, so it is still announced rather than
silent. The residual, accepted: an automatic check reports no per-step detail at all. The
alternative (broadcasting the steps) was rejected as a half-fix — the common path for a
moved-drive check is the user arriving on the screen mid-run, and a late-joining window has
missed the earlier one-shot messages, so it would show "Hardware detected: in progress" beside
"Generation speed: done". Back-filling the earlier steps was refused outright: the L3 rule is
that a step is reported only when it SUCCEEDED, so it would claim a skipped drive probe had
passed. Carrying the steps in PerformanceSnapshot would fix the late-join case properly and
stays the option if per-step detail is ever wanted for automatic runs.
Remaining hardware acceptance not yet performed: the hybrid iGPU+dGPU device-order check
and Apple Silicon unified-memory behaviour. Two items left this list: the two-computer round
trip on an encrypted drive, including an upgraded workspace with no history yet, was verified
2026-09-07 (#330, benchmark.md HW1); and the captured real partial-offload load log is done
(#329, 2026-09-08), which narrows the hybrid clause to its snapshot half — the PARSER side is
now witnessed by a real log (a Radeon iGPU listed first in device_info while every buffer
lands on the RTX, pinned as a fixture), so what stays open there is the SNAPSHOT's device
pairing on a hybrid box that also has a budget device (#332).
The one chat slot and the prompt cache (#319 / #399 / #512 — model-benchmarks.md §6.6)
The chat sidecar runs one server slot (-np 1, issue #319): the app is single-user and already
serialises every lane that reaches it, and four slots cost card memory exactly where the fit decides
between a full and a half offload. The consequence is that when something else takes the slot, the
conversation's KV prefix is evicted. On the b9849 engine most of the models we ship could not get
it back; on the b11146 pin (#512) the measured ones can. The bullets below say which engine they
describe.
Since the b11146 pin (#512, 2026-09-27) an evicted conversation is restored on the Qwen3.5 and
Gemma 4 models. Measured with the #399 protocol and the app's chat argv: 48 of ~1,700 tokens
re-prefilled on return for qwen3.5-4b/-9b and gemma4-e2b/-12b (b9849: 1,654–1,736), and
the restored answer byte-identical to a full recompute. qwen3.6 and qwen3.8 restore too:
measured on the RTX 3090 rig on 2026-09-27 (29 of ~1,550 re-prefilled; b9849 1,488–1,492; PR #524),
so all four #399 families keep the cache and no manifest sets disable_prompt_cache. Re-measured on the
b12110 pin (#729, GTX 1070 Ti, 30 conversations each): qwen3.5-4b and gemma4-e2b restore 30 of 30, and
every restored answer equals its recompute (b11146 beside it: 59 of 60).
A drive still carrying the b9849 engine loses that again. A drive set up before #512 keeps
b9849 until its engine is updated: the AI Model screen offers the update since #516 (pause,
update, resume), and fetch-runtime / the drive-setup script do it too. On it, the Qwen3.5 / Gemma 4 / Qwen3.6 / Qwen3.8 models now
write a host-RAM cache copy they cannot read (the #399 gate that switched it off is gone), bounded
by the ceiling below.
On b9849, on 13 of our 17 measured chat models an evicted chat prefix is re-prefilled from
scratch, not restored (measured 2026-09-08/09, #399; extended 2026-09-10, #446). llama-server saves the
conversation to its host-RAM prompt cache and then silently re-processes the whole prompt anyway.
Two architectures lose the restore: recurrent state — the whole qwen3.5 line (-2b, -4b,
-9b, -35b-a3b), both qwen3.6-27b quants and all three qwen3.8-27b quants — and a sliding
window — all four gemma4 manifests (e2b, e4b, 12b, 26b-a4b). That includes the
catalog-default 4B and the 9B, i.e. the 8–12 GB tier picks. Among ranked models only
ministral3-8b-instruct-2512-q4 keeps the restore; the dense qwen3-8b, the qwen3-30b-a3b MoE
and granite-4.1-8b-q4 keep it too, which is what makes this a measured architecture split rather
than an anecdote. Every chat family in
the catalog now has a verdict, qwen3.6 (affected) and granite (unaffected) being the last two,
measured under #446. (b11146 restores the Qwen3.5 and Gemma 4 rows — first bullet.)
A chat with a knowledge pack ticked pays a small, fixed re-prefill on every turn (measured
2026-09-18 on b9849, #447; not re-measured on b11146). The pack arm plans its search with one short model call before each answer,
on the same single slot, and that call and the answer evict each other's prefix every time: on
16 of 16 measured pack-scoped turns (qwen3.8-27b-ud-q5km and qwen3.5-9b-ud-q4kxl) the answer
kept 0 tokens where the same questions without the pack kept the 227-token system
prefix. The cache cost is that prefix and no more — about 0.35 s on the 27B, independent of
conversation length, because a documents turn never reused anything beyond it. The larger cost
is the planning call itself: 142–146 tokens in and a 53–71-token plan out, ≈ 2.6–3.2 s per
pack-scoped turn on the 27B on an RTX 3090 (≈ 1.6–1.8 s on the 9B), and more on a CPU, where
the decode dominates (#423). It is the running cost of the owner's "always plan" ruling
(rag-design §17 D-Z20; turning the call off roughly halves article-stage hits on English
questions), which the owner confirmed against these figures on 2026-09-18: the decode was
already priced into that ruling, and the part this measurement added is the bounded prefix.
A chat without a pack ticked pays none of it.
Evidence: eval/results/hardware/i9-9900x-rtx-3090-24gb-128gb/issue447-zim-expander.comment.md.
What can actually evict a live conversation is narrower than it sounds.assertChatStreamReady
makes categorisation, summary, translate, compare, OCR and every modelLane skill run refuse
a chat turn rather than take the slot from it. The one cooperative hand-back is the yielding
deep-index build, auto-enqueued when a document too large for the one-pass summary is ingested.
And a documents ask never had the history in the slot to lose: its retrieved-excerpt block
changes every turn, so only its ~227-token system prefix is ever reused. So the case that costs
real time is specific: a long document was just added, and you are having a plain chat — not a
documents ask — while it indexes.
Residual after the 2026-09-09 fix: returning from a break costs ONE slow reply. The arbiter
now waits 90 s after a chat turn before resuming a parked deep-index build, which removes the
per-turn churn — a conversation's own typing and reading gaps no longer hand the slot away turn
after turn. It does not remove the cost. A pause longer than 90 s still lets the build resume
and evict, so the first reply after that break re-prefills the conversation: once, not per turn
(on b9849; on b11146 a model that restores gets it back from the host cache instead, while the
cache still holds it).
Nor is the delay unbounded — a single park is deferred for at most 10 minutes, after which the
build resumes at the next release regardless. That cap is deliberate: a document that silently
never gets its deep index is a worse outcome than one slow reply. A steady chat every 30 s
therefore still pays a re-prefill roughly every 10 minutes.
The host prompt cache is on for every chat model, with a ceiling scaled to the machine (#512).--cache-ram is 1/8 of total RAM, at most llama.cpp's own 8,192 MiB default: 8 GB → 1 GiB,
16 GB → 2 GiB, 32 GB → 4 GiB, 64 GB and more → 8 GiB. Each saved conversation costs host RAM
(15–344 MiB per eviction on the models #399 measured), and when the ceiling is reached llama.cpp
drops the oldest entry, so the conversation left longest ago is the one that re-prefills.
Measured (#512, qwen3-8b): at a 16 GB machine's 2 GiB, six ~3,000-token conversations visited
in rotation outgrow the ceiling, so each is dropped just before it comes back and every return
re-prefills; at 8 GiB the same session restored every time. gemma4-12b saved up to 1.6 GiB for
a single conversation, so 2 GiB holds about one.
A manifest whose model cannot restore on the pinned engine opts out with
disable_prompt_cache: true (--cache-ram 0); none does today, and
tests/manual/prompt-cache-smoke.test.ts decides it for a new GGUF. On b9849 the #399 gate passed
--cache-ram 0 for qwen3.5, qwen3.6, qwen3.8 and gemma4. Chat only; the embedder,
reranker, translation and vision sidecars do not inherit the chat args and are untouched.
The measured speed-up (+38–45 % decode on the reference GPU) is deliberately narrow. All of these
are decided scope, not oversights; the record's §7 carries the reasoning.
GPU only — the runtime drops the flags off-GPU, structurally. The measured gain is a
full-offload result and MTP on CPU is simply unmeasured, so the forced-CPU rungs never carry the
flags. Dropping was chosen over proving it harmless on CPU because it is decidable without
hardware and cannot regress.
Opt-in per WEIGHT, never inherited by family resemblance. The draft head is a property of the
file, so a manifest opts in by name (speculative_decoding: mtp) and each new file is verified to
carry the head in-GGUF before keeping the field — Unsloth's Dynamic 3.0 publishes the MTP module
as a SEPARATE file for smaller quants, so "same family, same flag" would silently ship a broken
start (issue #196 §9.5 gate). A closed enum, not an argument list: manifests are user-editable and
LlamaServer.buildArgs appends extras LAST, so a hand-edited --host 0.0.0.0 would win.
Skipped silently when it will not fit, and invisible in the UI by design. The budget device
(the largest usable discrete card, never an integrated GPU) must report the weight's bytes plus
3.5 GiB free; free VRAM is never summed across cards (a multi-device split with a draft head is
unmeasured). A refusal costs nothing and falls through to exactly the
previous behaviour — but there is no user-facing signal, because there is no decision a user could
act on. The answer to "is it actually on?" is the log and perfMark('runtime_speculative').
RAM/VRAM lines in the manifests are pre-MTP figures and stay that way until re-measured with
the flag on. Manifest numbers are measured, never estimated.
On the b12110 pin the draft head is accepted less often (#800, accepted for v0.1.65). The
Qwen3.8 27B with MTP accepts 0.697 of its drafts against 0.754 on b11146, so it decodes about 4 %
slower (43.3 against 45.3 tok/s on the RTX 3090 at temperature 0); MTP still gives 1.48× over no
draft head, and answers are unchanged because the target verifies every draft. Without MTP both
builds decode at the same speed. The cause is not established (upstream #30141 is the suspect),
and the cost at the app's own temperatures is not measured. Re-measured at the next pin bump
(model-benchmarks.md §6.6 "#729 amendment", "Rig legs").
Watch item, not observed:measureTokensPerSecond counts stream CHUNKS. If a future
llama-server batched an accepted draft run into one SSE delta, the probe would under-read on an
MTP model and could feed the very-low-tps downgrade. Recorded so the next person who sees a
nonsense figure on a fast machine has the thread.
An upstream publisher can delete or replace a pinned weight, and we cannot prevent it. Hash
pinning means we can never be handed substituted bytes silently — but it also means a file that
moved is a file we can no longer fetch. A deleted source is recorded per-manifest
(download.withdrawn) so the app refuses by name before any request instead of ending a multi-GB
download in a 404; a live URL that now serves DIFFERENT bytes is the quieter failure and is found
by the periodic drift check (model-policy.md "Re-verifying the catalog against upstream").
A withdrawn model stays selectable on a drive that already has it. Its manifest is kept at
rank 0 with its dated note rather than deleted: the local file still matches the pinned hash, so it
verifies, starts and keeps its features. The consequence is a catalog entry a fresh drive can see
but never obtain — deliberate, and pinned by the invariant that no committed manifest is both
recommended and unobtainable.
Replacing a weight is a measurement wave, not an edit. Successors enter as NEW manifest ids
with their own measured quality/speed/RSS numbers; an in-place URL + hash swap would turn every
installed copy into checksum_failed overnight (precedent: issue #196, 2026-08-20). The one
exception is the next bullet, and it was still a measurement wave.
An installed copy of the pre-2026-07-17 gemma4-12b-it-qat-q4 weight now reports
checksum_failed, and heals by re-downloading (~7 GB). Google replaced that checkpoint
upstream at the same URL ("corrected vocabulary"), so the exact file the old manifest pinned is
no longer obtainable. It was re-measured against the corrected one before anything moved, and the
two are indistinguishable on every surface the app uses — all 100 grounded-QA answers
byte-identical, same memory envelope — so the manifest was repointed in place rather than
entering a second, provably identical catalog entry (issue #201; model-benchmarks.md §9.6).
No shipped drive carries the stale bytes: this model is not bundled on a preconfigured drive and
is not in the --with-assets default set. If your drive already has it, the AI Model screen shows
the checksum failure and Download fetches the corrected file over it.
A shard set is verified only when DECLARED, never inferred from filenames (#310). The
manifest's files: list is the only source of "this weight has more than one file" — the app
never scans models/ for a -NNNNN-of-NNNNN.gguf sibling series on its own. An older build
that does not know files: simply ignores it and reports shard 1 installed (today's
behaviour, no worse; a forward-compat format marker is #311's containment decision, not built
here). There is also no per-file view in the UI yet — the Models screen's technical details show
only the primary path, even for a multi-file weight.
Accessibility (WCAG 2.2 AA sweep — consciously accepted)
The sweep contrast-audited every role-token pairing in both themes (fix applied:
--border-strong → --n-500, the only sub-3:1 non-text boundary that was the SOLE component
identifier), added forced-colors (Windows High Contrast) rules for the custom-drawn
controls (Switch, strength meter — #151 KL-3: the inventory is now THREE, the chat context
meter .context-meter-track/-fill joined later and carries no forced-colors rule; accepted
because its value is never color-only — the numeric label carries the meaning), and verified
the reduced-motion kill-switch.
Was an open defect; FIXED 2026-09-10 (#436), kept here for the lesson. Verified by ear with
Narrator on 2026-09-09 (issue #331), against a positive control that proved live regions do work
in the app's own Electron window: ErrorBanner's message was never announced. The component
exists to implement audit finding M-U1 — an always-mounted role="alert" aria-live="assertive"
container whose text swaps inside it — but the Banner nested within it carried role="status",
which is itself a live region (implicit aria-live="polite") and WAS mounted with its text. The
nearest live-region ancestor governs, so M-U1's anti-pattern was reintroduced one level down. It
was the shared failure surface for 11 screens, and for WorkspaceGate's wrong-password banner
— the SH-2 / #145 fix — so a failed unlock was silent too. A control isolated the remedy:
aria-live="off" on the inner element does NOT help; the inner live-region role has to go. The
lesson generalises — role="status" and role="alert" are both live regions, so nesting one
inside the other silences the outer one.
The fix: Banner's role prop takes null (render no role), ErrorBanner passes it, and
ModelsScreen's hand-rolled copy of the same wrapper — two more nested role="status" Banners,
outside the issue's stated blast radius — was corrected with it.
tests/unit/live-region-nesting.test.ts now parses every renderer .tsx and fails on any
live-region role nested inside another, so the shape cannot return unnoticed. The by-ear
re-verification (Narrator, on a real failure and on a wrong-password unlock) is still
outstanding — the DOM half is pinned, the audible half needs the hardware box.
Accepted as-is, with reasons:
Hairline --border separators are ~1.3:1. They are decorative row/card separators,
never the sole identifier of a component (cards pair them with surface fill + shadow;
inputs use --border-strong). WCAG 1.4.11 applies to required boundaries only.
"The app could not start" shows an error code, and its last-resort form a raw error string. §7 keeps error
codes inside Diagnostics, but when the back end never came up Diagnostics is unreachable. Since #1024 a start that
throws shows the gate's card with the error's code alone (EPERM, never a message or a path) and "Copy details for
support"; the fatal screen, now only for a failure state that could not be registered either, still shows
Electron's IPC error string (it names only the channel) and no longer points at logs/app.log.
The Documents screen's per-row selection checkbox is 16px (#151 KL-2: numbers
refreshed — 16px in a 56px row). Under the 24px target minimum, but WCAG 2.5.8 is
satisfied via the spacing exception: the tall row means no other target falls within the
24px circle around it.
The bundled main process can contain a duplicated, tree-shaken copy of a module
(observed: workspace-vault's WrongPasswordError/shredFile), which breaks cross-copy
instanceof. The wrong-password mapping now also matches err.name; other duplications
are benign (pure functions). Root cause in electron-vite/rollup module ids — not chased
in this phase.
A pure-code-block streamed answer announces nothing to screen readers until completion
(accepted). The streaming StreamAnnouncer (a visually-hidden
role="log") feeds AT only completed sentences, falling back to a word boundary once a
terminator-less tail grows past a soft cap (so tables / lists / run-on prose now announce
incrementally). But stripMarkdown collapses code/markup to spaces, so an answer that is only
a fenced code block strips to ~nothing and stays quiet until the final turn re-renders — voicing
code punctuation token-by-token is worse a11y than silence. Any surrounding prose still announces
normally; the visible bubble shows the code in full. (architecture.md "Renderer robustness" Phase D.)
History. Many bullets carry short finding ids (D77, SKA-24, C1, audit §N.M, …): they
resolve through the design records and their §-anchor legends in
architecture.md / rag-design.md. The underlying audit
reports and phase plans were working papers; their full text lives in git history.
A hand-placed kiwix-tools bundle carries no install marker. The kiwix_tools family can
now be installed from inside the app (the Knowledge-packs panel's tools-missing notice, or the
mirror row on the AI Model screen, #339 P8-2) or via fetch-runtime --family kiwix_tools
(#339 P8-3) — both write a .hilbertraum-runtime.json marker hashing every required file, so
kiwix-serve/kiwix-manage verify normally before every spawn. Unzipping the archive under
runtime/kiwix-tools/<os>/ by hand still works as a last-resort fallback, but leaves no
marker, so it resolves through the hashless skip-legacy verifier path (residual R-1) instead
of integrity verification — and it is replaced wholesale the first time someone installs
the family from inside the app or the script (the in-app installer builds a fresh copy beside it
and swaps it in, #986; the script pre-cleans the family's directory before extracting), so a
manually provisioned drive is not stranded, only superseded. The
in-app install needs Settings → Allow internet access for downloads and updates on
and a drive policy that permits downloads (the same gate models and the engine use). Linux and
macOS builders without the in-app path use the script.
On Windows, an archive can only be added if its file name, and any folder it sits in outside
the app's own folder, is made of ASCII characters. Both pinned kiwix-tools 3.8.1 programs
mis-read an umlaut, an accent or any other non-ASCII character on their command line. Since #787
they start in the app's own library folder and get every path in an ASCII spelling from there
wherever one exists (rag-design.md §17 D-Z1 "#787 amendment"): a drive or app-data folder such
as C:\Users\Jürgen\AppData\Roaming\HilbertRaum works, the packs in its zim/ folder included,
and so does another folder of that account (C:\Users\Jürgen\Downloads). What has no such
spelling stays refused: a FILE NAME like Wiki für Kinder.zim, or a folder like
C:\Users\Jörg\Downloads beside a Kit on D:\. Starting the tool in the archive's folder would
reach those, but Windows also looks for DLLs there, and the pinned build needs the Visual C++
runtime the app does not bundle, so a file planted next to a download could run inside the tool
(decided 2026-11-08). The panel names that cause and the workaround: copy the file into the
drive's zim/ folder under a name without such characters (the archive's metadata is still read
through kiwix-manage, #340's ruling of 2026-09-06). Serving is not affected. Not measured: a
drive or app data on a network share (\\server\share). macOS and Linux are not affected.
A redirect entry (an alias title) opens the article it points to — one hop, same pack.
About half of a Wikipedia ZIM's entries are redirects; kiwix-serve answers them with a 302
rather than the target's bytes, and the viewer follows exactly one such hop inside the same
pack (P7 fix). A redirect to another pack, a chain of redirects, or a target that fails the
entry-key rules shows the honest "article unavailable" state instead — never another pack's
text.
The pinned Windows pack server sometimes cuts a large article read short. kiwix-serve
3.8.1 (win-x86_64) cuts roughly one in ten to twenty reads of an article larger than about
80 KB short — the response starts normally and the last part of the body never arrives —
measured against the raw server with no app code, with two different HTTP clients and every
thread setting; small entries never stall (P7 real acceptance,
rag-design.md §17 "Real acceptance" finding 3; an upstream defect, tracked for the
provisioning wave on #339). The linux-x86_64 build of the same release does NOT show it
(humaniser's probe of 2026-09-07: 0 of 40 reads short on the same entries, every thread
setting), so the upstream report names the Windows build only. The app no longer triggers it
(2026-09-08, rag-design.md §17 D-Z22): every article request asks for a byte range, which
makes the server read the entry through a different, sound code path — 880 such reads on the
Kit drive without a single short one, against 70 of 600 short on the plain route in the same
session, and 60 consecutive article opens with no retry at all where the plain route needed 13
and lost one article. The old detector stays as the safety net behind it: a read that goes
quiet mid-body for a second, or an attempt that runs past 4 s, is retried up to three times
(ARTICLE_READ_IDLE_MS / ARTICLE_READ_TIMEOUT_MS / ARTICLE_READ_ATTEMPTS in client.ts),
and a stall that did deliver part of the article is now resumed from where it stopped rather
than read again. Only a read that fails all three attempts shows "article unavailable" or costs
the answer that one article, and the per-answer note then reports what was searched. The
upstream defect itself is unchanged; the report to kiwix/kiwix-tools is still to be filed.
The app never downloads an archive for you — by design (decided 2026-09-09, #417). It
installs the tools that read archives (kiwix-serve and kiwix-manage, from the Knowledge-packs
panel or the AI Model screen, after you accept the licence), and it stops there. Getting the
archives themselves is yours: download a .zim from library.kiwix.org (or anywhere else) in
a browser, then copy it into the drive's zim/ folder or add it through Add packs…. There is
no in-app catalogue to browse or search, and nothing tells you when an archive you have has
been republished in a newer edition — you would notice that on the Kiwix site and download it
yourself. The reason is not effort: everything the app offers to download is an exact file it
has pinned, with a size and a checksum it verifies before use, and a live catalogue cannot be
pinned that way — the app would have to quote you a size, a licence and a title it had not
checked. Downloading in a browser also gives you the things the app could not: a resumable
transfer you control, and a free choice of edition (nopic, mini, maxi).
Multipart .zimaa archives are unsupported (R-2). A ZIM split across multiple
.zim<aa|ab|…> parts is not read by this app; only a single-file .zim archive is. This
is unsupported AND UNTESTED: no code path explicitly rejects a multipart archive, and no
test currently pins that rejection.
Packs ride the RELEVANCE ask path only. Whole-document reads, compares, and
doc-task flows are document reads by definition and never consult packs.
A pure-archive answer records no coverage fraction (there is no document corpus to
be “N of M sections” over). Evidence review resolves archive citations as honest
unresolved by construction, not by matching-title accident: the resolver and its
read-time whitelist both check sourceKind before any document-id/title branch runs
(PR #294 review H2, #301). There is no full-archive content hash, so a review can
never verify or date an archive article — freshness reports it "cannot be verified",
never "changed" — and that stays a limitation, not a defect. The review, its HTML/PDF
evidence pack and the Markdown transcript export still record the pack id and article
path even though identity is unresolved. A review row's archive citation now opens
through the same "Open article" viewer as chat (P6): it resolves by the pack's UUID
against the review's own frozen snapshot, so a renamed pack still opens; a removed or
currently-unplugged pack says the article is unavailable, same as chat. Evidence reviews created on a pre-release knowledge-pack
build that cite an archive may carry a wrongly resolved document identity and must be
re-run; the app never rewrites a frozen review.
A saved article ("Save to my documents" in the article viewer, #340 Tier-2, D-Z21) is a
snapshot, not a live link. It is titled with the pack's title as it read AT SAVE TIME —
renaming or re-adding the pack afterward does not retitle a copy already made — and it is
never updated when the underlying archive changes; a newer edition of the same article needs
a fresh save. The Documents screen groups it under Generated with a provenance line naming the
archive it came from (it also sits in the Library like any import, so a default chat finds it), and it never goes stale the way a summary or translation can, because it
has no source document to fall behind. Not built: a citation-card shortcut that saves directly
without opening the viewer, and an "Open in Documents" jump from the viewer's saved state.
Serving names are computed, not read back from the running server. Every enabled
pack's serving name follows the pinned libkiwix 14.1 getHumanReadableIdFromPath rule
exactly (identity.ts); when two packs would compute the SAME name, the smaller UUID
wins by libkiwix's own ascending-map-order rule and the later pack is excluded from the
served library until it is renamed, rather than answering under the winner's name (the
panel shows a "Not served" badge on the later pack naming the pack that keeps the name —
packs:status.excluded, rag-design D-Z16, #340 — and the per-answer note says "not searched:
name collision with another pack"). The real-tool check that our computed map still matches a
pinned kiwix-serve build is P7's (T19), not assumed here.
At most twelve packs take part in one ask, and not every candidate they find is
used. Ticking a 13th pack is refused; an older or hand-edited selection above the
12-pack limit is trimmed in title order, with a per-answer note that it was not
searched. "Title order" here is the plain code-point order (A to Z, then accented and non-Latin
initials); the chat picker and the Packs panel list packs in the interface language's own order
(#958), so for such titles the two can differ. Of the up to 24 archive candidates admitted per ask, each ticked pack's share
is decided round-robin, in title order, only after every pack has finished searching —
a short or empty pack's unused share goes to the others — and at most two packs are
searched at a time, under a twenty-second limit for the whole question (a pack cut off
mid-search is reported as "failed: timed out", one never reached in time as "not
searched: out of time for this question"). The pack server ANDs every word of the search pattern, so the app sends only the question's content words (function and question-frame words stripped, rag-design.md §17 D-Z18); if that alone finds nothing at all, it retries ONCE with a narrower version of the same words (five letters or longer only, when that differs from the first try). A question whose remaining content words never co-occur in one article can still miss. This search step itself does not consider language: a German question against an
English pack simply scores poorly; the reranker sorts it out when present, and without
one, expect occasional off-language chunks. EVERY pack-scoped question (not only aggregation
or superlative ones) gets one extra step before the search: the app asks the local model for
a short search plan — up to three candidate article titles and two full-text search queries,
never an answer, never a guessed fact — which recovers most of the cases where the question's
own words don't match the answering article's title or index entry (a list or superlative
question is the clearest example, but any question benefits). That step now asks in a ticked
pack's own language instead of the question's when the two are confidently detected to
differ — but only for a question it can read as German or English (a small, offline
word-list check, not a language classifier). It can then name any of fourteen mapped
languages the ticked pack declares — German, English, French, Spanish, Italian, Dutch,
Portuguese, Polish, Russian, Swedish, Turkish, Arabic, Chinese or Japanese — not only
German or English. Every other case — a question the check cannot classify, a pack whose
declared language is unset or outside that list, or a pack that declares more than one
language (a comma- or semicolon-joined value is now split and each part mapped on its
own, but a pack marked mul, und or mis — "multiple", "undetermined" or "uncoded" —
is treated as unknown and suppresses the substitution for that question) — still plans in
the question's own language, exactly as before (#486). What that step costs is set
by how long the model's answer is, not by how long the app has been running. Measured on a
fast desktop processor (32 threads, of which the app uses 16) with no graphics card: about four
to six seconds with Qwen3 4B Instruct, and six to ten with Qwen3.5 4B, the model the app
recommends for a computer with up to 12 GB of memory. Writing the plan is nearly all of that
time, and Qwen3.5 writes it indented, so a third or more of what it writes is spacing; a
processor about a fifth slower than that one runs its longest plans past twelve seconds
(#716). On a graphics card the same questions take about half a second.
On a much more thread-constrained processor (a two-thread stand-in for a slow machine) they
take seven to twelve seconds, and 1 of 50 measured questions on that configuration (2%)
ran the full twelve seconds without a usable reply — the plan step is more likely to run out
of time on such a machine than the shorter question-plan it replaced, an accepted cost of
asking for richer search vocabulary (measured against a like-for-like comparison on the SAME
configurations: the plan step's own "no usable reply" rate never exceeded the older step's,
either at full threads or at two). Separately, on the FASTEST machine measured (a graphics
card), the model's reply is cut off, not just slow, for about 1 question in 200: the plan's
length cap is a whole-number multiple of 8 tokens and the longest reply measured landed one
token past it, so that one reply (and any as long) is truncated and treated the same as no
reply — the plan step still falls back cleanly, it just does so slightly more often than a
looser cap would have. A question whose answer is spread across an article's
individual rows, rather than named on the page itself, can still miss; and on a machine slow
enough that the call runs past twelve seconds, the question falls back to the plain search
with no title/query step — the answer is still grounded and still cites what it used, it is
just the plain search's articles. That fallback also costs the question those twelve seconds
before any pack is searched, out of the twenty the whole question is allowed. Three ways around it were measured and not
taken (#716): keeping the part of a cut-off plan the model had already finished, and having it
write its search queries before its titles, each found the same list articles as no plan at
all on the climate-change pack (two of six, on a processor emulated two and a half and four
times slower), and writing the queries first made the plans longer; forcing the reply onto one
line made it a third shorter but garbled a third of the plans. Every ticked pack gets one line in the
"Knowledge packs:" note under the answer — searched (and how much it contributed) or
not searched/failed with a short reason — even on an answer that cites nothing at all;
an older answer, from before this note existed, says "outcome not recorded" instead.
Whether a pack can be searched is confirmed only by asking it, once. A ZIM
archive's own metadata tag is a hint only. The app confirms full-text search capability
with one request to the pack server (cached against the archive file and the
kiwix-tools build, so a replaced file or a new tools install re-checks automatically,
and Refresh re-runs it too). The check runs when you unlock, when you press Refresh, and — a
moment after — when you add a pack through Add packs… or enable one; until it completes,
the pack is treated as searchable, so a question asked in that moment against an index-less
pack reports "search failed" rather than "no full-text index". A 404, a timeout, a malformed reply, or a reply observed across a
pack-server restart never confirms "no" — only a clean, positive or negative reply
does. A pack confirmed to have no full-text index is skipped for asking ("not searched:
no full-text index") but stays fully readable in the article viewer, which never
consults this check.
Turning off "Search my documents" does not affect files attached to the chat.
With the toggle off, a chat answers only from its ticked knowledge packs plus any files
you attached directly to it — a project selection or a hand-picked document is dropped,
an attachment is not. The plain, empty "All documents" selection is unaffected by this
feature and still means the whole document corpus. Turning documents back on, or
picking a collection or a document while off, resets to the ordinary all-documents (or
attachments-only) behavior — there is no separate "restore my previous selection" step.
Content licensing is the user’s call. Registration accepts any readable ZIM;
nothing checks the archive’s license terms (relevant only for redistribution, not
for private use).
Very large or malformed articles convert partially. An article whose markup
exceeds 1 MiB, whose scan exhausts the work budget, or whose HTML is unterminated is
converted only up to the cut: retrieval uses the text extracted before it, and the
article viewer shows a hint that only the first part of the article could be
displayed rather than presenting the partial extraction as the whole article. The
parser no longer stalls the main process for a whole article (P1b: the conversion is
cooperatively sliced and abortable on the ask path); the slow-hardware per-slice figure
(the i7-8550U reference laptop) is now recorded — laptop leg 3 PASSED at
DEFAULT_SLICE_WORK = 16 Ki, p95 2.4–2.7 ms against the 5 ms bound — see
rag-design.md §17 D-Z3.
A kiwix-serve or kiwix-manage child that cannot be confirmed stopped within the
teardown bound (SIGTERM → SIGKILL → a bounded wait — ≈5 s total for kiwix-serve,
≈3 s for kiwix-manage) is reported as cleanup NOT CONFIRMED, never "complete": its
PID stays on the crash-reap list and its library.<n>.xml build (or, for
registration, its throwaway metadata temp directory) is left under
workspace/zim-transient/ until the app sees that child exit, and is removed then (#713); a
child whose exit never comes leaves the file until the next app start. Separately,
kiwix-manage on a legacy hashless install marker runs with a logged warning
instead of integrity verification (residual R-1) — retained until the
provisioning wave above proves both binaries' verification and repair.
workspace/zim-transient/ (P3b) holds only the generated library XML the pack
server reads — library.<build>.xml and, during registration, a throwaway
meta-<n>/library.xml — plaintext while present in both workspace modes, and
removed at lock, at quit and at every session start after a containment check
(a symlinked or junctioned zim-transient/ dir is refused outright, never followed).
Explicit limits: a file belonging to a child whose death could not be confirmed stays until
the app sees that child exit, or until the next APP start if it never does — lock, quit and
session start keep it until then (#713); a file a stray process still
holds open on Windows is left in place and reported, never silently called clean.
The pack server has no password of its own (residual R-9). While the workspace is
unlocked and a knowledge pack has been used in a chat, other programs running under
your own user account on this computer can read the enabled packs through the pack
server, which has no password of its own; locking or quitting stops it. kiwix-serve
has no request-authentication feature upstream at all, so the app bounds the window a
same-user "port squatter" could exploit with the request guard (ZimService.withServer):
every request is checked against the app's own server lifecycle before and after, a
response observed across a lifecycle change is discarded, and the request is retried
at most once — this detects a lifecycle change of the app's own child, never the
server's identity. Residual windows: the brief race between picking a port and the
child binding it, a delayed notification of the child's exit, and whether a second
same-user process can bind the port while kiwix-serve still holds it (left to the
real-tool acceptance run). --urlRootLocation exists in kiwix-tools 3.8.1 and is
deliberately NOT used — a path prefix in argv is readable by any local process, so it
would be obscurity, not authentication (residual R-8, a documented unused option).
Revisited only if upstream kiwix-serve adds authentication.
Table delivery (issue #478) leaves a few residuals. A cut table (row/char/segment/
column/grid-cell caps) does not say what a cut row or cell itself contained, only how
many were shown — the [Rows 1-k of N source rows shown] (N counts every top-level
row including header rows) and "some cells beyond the table's size caps were omitted"
markers name the gap, never fill it; a cap firing inside a NESTED table folds into the
same two markers on the outermost table, so a cut inside nested content is disclosed
the same way. A line or key/value pair that alone exceeds the remaining raw-character
budget (typically a nested table's own inlined content, close to that same shared cap)
is truncated to what remains and kept rather than dropped whole, so a table is never
reduced to markers over zero data rows when some of its content was in budget; the kept
prefix can still end mid-value, not at a natural word or pair boundary, and that cut
carries no line-level mark of its own — today's size thresholds happen to keep a
mid-number cut unreachable in delivered text, but that is an undocumented coupling
between two constants, not a guarantee, and a future change to either one could ship a
truncated value with no visible marker on that line. A cut landing inside the one emitted
line of a single-row (or otherwise fully-consumed) table can also leave the "rows shown"
marker reading as if every source row were present, even though most of that row's text
was cut — the cut is disclosed on the line itself, but not echoed into the row count.
Neither is fixed here. Row/column
iteration is bounded on three independent axes
(TABLE_MAX_COLUMNS, TABLE_MAX_GRID_CELLS, TABLE_MAX_RAW_CHARS, alongside the
existing TABLE_MAX_SOURCE_ROWS), not merely by "typical tables are small": a table
whose grid or emitted text would otherwise exceed one of those caps is cut. This
narrows, but does not close, the cooperative-slicing ≤5 ms bound for a single very
large kept table — a scoped review of this step measured the pre-cap cost at up to
~5 s / ~2.3 GB heap for one crafted 1 MiB table; the caps bring that down to tens of
milliseconds (measured worst case ~12–20 ms for a 1 MiB table, whether the size comes
from one huge grid or from thousands of small tables nested inside a wrapper — a
nested table's own grid-expansion/line-building cost is now charged into the same
work counter and bounded by a shared budget, closing what used to be an untracked,
uncapped cost that scaled with nested-table COUNT rather than with the caps), but the
pass itself is not cooperatively sliced and still runs to completion in one
uninterruptible stall before the next slicing checkpoint, so the ≤5 ms gate does not
literally hold for a single very large kept table (nested or not) even after this fix.
The layout/navbox classifier is class-based (navbox, vertical-navbox, metadata,
ambox, toc, sistersitebox), applied at every nesting depth (a table nested
inside a kept table is checked and dropped the same way the outermost one is), and
can misjudge an unlisted layout convention, or a genuinely tabular one that happens to
reuse a listed class name; the structural test (no header cell, no real tabular
content) is a backstop, not a guarantee. A disclosed instance of that backstop's
limit, still open as issue #487 — now with the measurement the issue asked for: a
classless two-column layout wrapper whose cells are an image and its caption (e.g.
<table style="float:right"><tr><td><img></td><td>caption text</td></tr></table>)
carries no listed layout class and has two non-empty cells, so it clears both the
class check and the structural check and is delivered as ordinary table text — the
<figure> drop rule exists to keep exactly this kind of caption text out, and this
shape re-admits it under a different tag. How often, and what it would cost to drop
it. A structural rule for this shape was written and measured on the offline corpus
(1,437 articles, 2,151 tables) before being withdrawn: drop a headerless table when one
of its cells holds only an image and no source row holds more than one other populated
cell. It changed three tables in the whole corpus, none of them on the 949-article
Wikipedia corpus. Two were the wrapper shape above, correctly dropped. The third was a
Wikivoyage travel-notice box laid out as a table — an icon cell beside the notice, then
a row carrying the heading and the list of governments issuing the advisory — and
dropping it removed seven delivered lines of that advisory. That is content, not
layout, so the rule was withdrawn: two stray caption lines gained corpus-wide is not
worth one deleted travel warning, and the shape is left delivered. A narrower rule
remains possible (both correct drops sit in MediaWiki's caption furniture — a
thumbimage cell and a thumbcaption div — which the notice box has neither of), and
since a figure's own caption is now delivered on purpose (below), a caption arriving as
a table line is closer to a formatting oddity than to noise. Also measured, and also
not usable as written:role="presentation", the standard ARIA marker for a
layout-only table, which #487 proposes as a second, independent drop signal. Exactly
four tables in the corpus carry it, and all four are German-Wikivoyage travel/warning
notices that are delivered today — so a role="presentation" drop rule would delete
four warning boxes and nothing else. A nested table's own further-nested tables
are inlined down to a fixed safety-valve depth (8); deeper nesting is dropped,
unchanged from the feature's first design. The superscript/subscript readable
convention (g/cm^3, 10^6, H_2O) applied inside table-derived text only when
table delivery shipped — prose kept today's flattening (m<sup>2</sup> → m2) as a
deliberate scoping decision, reported rather than fixed there. It is fixed now (#488):
prose and headings emit the same markers, from the same module as the table path
(zim/supsub.ts) — every heading except the article's title, which keeps the archive's
own spelling (CO2-Steuer) because it is the citation and the viewer's heading (#711) —
and the retrieval matchers fold the markers back out of BOTH the
question and the article text, so every alphanumeric run of the text a matcher compared
before is still a substring of what it compares now. A marker is written only where it
will sit BETWEEN two alphanumerics, so the reference back-links, the bracketed notes
(^[note 1]) and the empty <sup></sup> that the feature's first cut marked are
unmarked again. Two residuals remain, by design. An exponent whose base ends in a
non-alphanumeric loses its marker — (a+b)<sup>2</sup> reads (a+b)2 — because the rule
reads only the one character before the element, and ) is not one a marker may follow
any more than the space before a back-link is. And the fold is now
symmetric in ^ and _ (a census measured the digit-only _ rule splitting 86 real
match terms — NO_x, SO_x, pK_S, T_krit), so a typed snake_case yields the one
term snakecase: it still matches an article writing it the same way, but no longer one
writing snake case. Removing table from the scanner's SKIP_SUBTREE set also
changes html.ts's recovery on unbalanced markup OUTSIDE any table — e.g.
<p>before</p><figure><table></figure><p>after</p> now returns before and after
as two segments, where it previously dropped the tail after the stray <table> inside
the (already-dropped) <figure> subtree threw off the skip-depth count. This only
differs on malformed input that nests a <table> inside another dropped subtree, and
the new behaviour recovers MORE text, never less. Five tables32 ids (H016, H062,
H076, H158 en, H181 de) are discovery losses this change cannot fix — their gold
article never reaches the candidate pool at all, on any arm.
Two known defects that shipped with table delivery are now FIXED, each
measured after the fix over the same 949-page sample. A <style>/<script>
element nested inside a kept table no longer leaks its raw body into the
retrievable text — it is dropped exactly the way the main document scanner
already drops these two elements outside a table (#485). A formula (<math>)
nested inside a kept table is no longer delivered twice over — once as the
loose characters of its rendering markup and once as its raw TeX source —
because it is now routed through the same plain-text-description-once path
ordinary prose already uses, never a plain drop, since a formula cell is
often the value the table exists to deliver (#490). Measured after the fix:
zero table-derived retrievable units carry stylesheet source, and zero carry
either half of the doubled-formula signature, offline over the full sample or
in a fresh read's own candidate/packet lists; zero user-visible citation
snippets carry either. Of the 261 in-table formulas the sample contains, 259
reach the delivered text with their normalised value intact; the remaining
two are individually accounted for, not silently dropped — one formula
normalises to whitespace only (its own rendered value carries no visible
character), and one sits in a very large table whose own row/segment cap
consumes the row that value sits in. A related, explicitly out-of-scope
class: literal MediaWiki template placeholders (e.g. {{{Druck}}}) that
appear inside a table are the source page's own content, not markup the
converter failed to drop, and are left as-is. FIXED (issue #493): a
further, rarer container used not to be stepped over on this same
path — a CDATA section holding a bare > inside a kept table could have
its content delivered as table text, where the main document scanner
already steps over such a section. The table path now mirrors that same
step-over. No occurrence was found across the sampled pages before or
after the fix (the practical frequency on real articles is genuinely
zero); the fix is demonstrated by a pinned fixture — a table cell holding
a CDATA section with a bare > inside it — that leaked before the fix and
does not leak after it.
FIXED: a <figure>'s caption text never reached a segment. The whole
<figure> subtree — image and <figcaption> alike — used to be dropped,
unlike a table's own <caption>, which is kept. An open <figcaption>'s
text (while inside a dropped figure) is now captured into its own
Caption: ... segment, the same labelling and flush order the table path
already uses; the image, its alt text, and everything else in the figure
subtree stay dropped. MediaWiki's .thumbcaption convention is
deliberately not given a capture of its own — it already reaches delivered
text as ordinary prose outside any <figure>, so a second capture would
deliver the same text twice. Measured on the 949-article corpus (which
contains no <figure> tag at all) as a no-regression guard: pooled
figure-caption class coverage is byte-identical before and after
(99.63 %). Measured on seven cached non-Wikipedia archives: of 191 real
<figure> tags (148 with a non-empty caption), 141 (95.3 %) now reach a
delivered segment, up from 0 before the fix; the remaining 7 sit inside a
Wikivoyage image-gallery grid built as a <table> of <figure> cells —
the KEPT-TABLE subtree-skip path documented above, unchanged by design.
Since 2026-10-07 a caption's superscripts, subscripts and citation
brackets follow the prose convention (#488) too: before, a caption read
H2O and m2 and kept [2], where the text around it read H_2O.
Site furniture and code blocks (#627). A crawled site's footer, menu or
sidebar is dropped when a p, div or section carries one of eight
class tokens exactly (footer, site-footer, nav, navbar, menu,
sidebar, breadcrumb, cookie), and a <pre> code block keeps its
indentation. Residuals:
Furniture marked any other way is still delivered: a prefixed class
(bd-sidebar, left-sidebar, footer-article-items), an <aside>, a
<footer> element (still only a block boundary), a ul.menu. In the
other direction, a content box whose class is exactly sidebar is
dropped — DocBook and docutils' HTML4 writer (Sphinx before 2.0) render
their sidebars that way; Sphinx's default HTML5 writer uses <aside>,
which the rule leaves alone. Neither direction was seen in the 2,672
pages measured.
Wikipedia's license line and German navigation boxes: "Wikipedia's
license line and German navigation boxes (#662)", below.
The indentation reaches the article viewer and a saved copy only. The
chunker splits on whitespace, so retrieval, the reranker, the prompt and
citation snippets read code as one flat line, as before. The viewer shows
it in the reading font, not a monospace one; a blank line inside a code
block starts a new paragraph there; and a saved copy loses the indentation
of a section's first line when the section starts with code (it trims the
section text).
In a kept table the first line of a cell's code block follows the column
key (docs: code) and is not indented; later lines are. A gap inside a
line keeps its width but its first character becomes a space (a lone tab
mid-line reads as one space), and a single kept run is capped at 256
characters. A kept table keeps at most 6,000 characters of such
whitespace in all (TABLE_MAX_KEPT_WHITESPACE); past that its code
collapses as before.
Named entities: "Named entities (#663)", below.
Wikipedia's license line and German navigation boxes (#662). mwoffliner's
license line (div.zim-footer) is no longer article text: it is returned
apart (PackArticle.notice), shown after the article in the viewer and
closing a saved copy as a ## License section. German Wikipedia's
navigation boxes built as divs (navileiste, erweiterte-navigationsleiste,
erw-nav-leiste) are dropped. Residuals:
Three more German Wikipedia boxes share the class
navigation-not-searchable with the navigation boxes, which is why that
class is not part of the rule. #673 handles them by their own markers:
"German Wikipedia's Normdaten, Rechtshinweis and Schwesterprojekte boxes
(#673)", below.
Measured on German Wikipedia and Alpine Linux's wiki only. Another
Wikipedia's navigation boxes built as divs under other class names are
still delivered; the ones built as tables were already dropped (navbox).
The notice is plain text: its links (the article's revision on Wikipedia,
the license deed) are not kept, as no link target is (#416). It is one line
of at most 1,500 characters, in the archive's language (shown without a
lang attribute, like the article text above it); a longer one is cut and
ends in "…", and a second license line on one page is appended to the
first. An article cut short before its end has none.
A saved copy's License section is ordinary document text: a documents
chat can retrieve and cite it, and ten saved Wikipedia articles are ten
such sections. Before, the same line sat inside each copy's last section.
An article that has a "License" section of its own then has two.
A copy saved before this change keeps the license line inside its last
section. Saving the article again answers "already saved"; delete the copy
on the Documents screen and save it again to get the new shape.
German Wikipedia's Normdaten, Rechtshinweis and Schwesterprojekte boxes
(#673). The sister-project links (div.sisterproject) and the
legal-topics notice (div#Vorlage_Rechtshinweis) are dropped. The authority
data (div#normdaten) is kept, as a section of its own named Normdaten.
Residuals:
The rules are German Wikipedia's markers: the Rechtshinweis and Normdaten
boxes are matched by their template ids. Another Wikipedia's sister-project
or authority-control box built as a div under other names is still
delivered as text (the ones built as tables were already dropped).
In the viewer the Normdaten heading is followed by the box's own line,
which starts with the same word (Normdaten (Person): GND: …). Its numbers
are plain text; their links (d-nb.info, viaf.org) are not kept (#416).
Text after the box in the same section (2 of 227 sampled pages, such as
Huawei's coordinates line) follows as a second part of that section, so the
viewer shows the section's heading twice and a saved copy has two sections of
that name, as around a table.
A section whose only content was a sister-project box (58 Weblinks
sections in the sample) is left with its heading alone, like any section
whose content is dropped.
The viewer still tells a heading's segment by its text: a later paragraph
of a section that is exactly the section's name, after a table or the
Normdaten box, is taken for the heading and not shown.
A copy saved before this change keeps the boxes as they were. Delete the
copy on the Documents screen and save the article again to get the new
shape.
Named entities (#663). The converter decodes HTML 4.01's 252 named
entities plus ' (typographic quotes, dashes, arrows, Latin-1 letters,
Greek, math symbols, €) and numeric references (’,
’). Residuals:
Decoding is single-pass by design: &rsquo; reads ’, the
literal text a page about HTML means.
,  ,   and   read as ordinary spaces and
­ as nothing, as before #663; their numeric forms and the literal
characters decode to the characters themselves.