Wiki / CaseKeeper

CaseKeeper Wiki

v0.8.0AdministratorsDevelopers

Installing, configuring, securing and supporting CaseKeeper — and everything a developer needs to build, understand and release it.

Reminder: CaseKeeper is a filing and organising tool. It does not give legal advice, and nothing it produces replaces advice from a solicitor, barrister or advice service.

Administrators

What CaseKeeper can do

A full overview as of v0.4.0. Everything runs on the user's own PC; nothing is uploaded unless the user chooses a cloud AI provider (since v0.6.0, see Privacy & security).

AreaFeatures
Modes & navigationSimple mode (essentials, plain English) or Professional mode (adds costs, Scott schedule, AI analysis, exports and the audit trail). Ctrl+K command palette, F1 help per screen, first-run welcome and getting-started checklist. Sidebar grouped into Overview, Papers, Track, Produce and Help & system. Dark teal and light themes.
DocumentsImport PDFs, photos, scans, Word and text files (originals never touched). Explorer with right-click menus and sub-menus, drag and drop (including from Windows onto a category), rename (F2), selectable columns (Exhibit, Tags, From, Type, Size, Added), smart folders (Recently added, Needs attention), Starred, and Deleted items kept 30 days by default. Exhibit references (AB1, AB2…) in date order. Windows OCR makes scanned text searchable; notes on every page and document.
Bulk Case ImportImport a whole case folder and its subfolders in one go, with a full preview first (duplicates by SHA-256 contents, unsupported and unreadable files, folder-to-category mapping). Originals are never moved or changed; the folder structure is kept. Pause, stop and resume, even after closing the app. Optional local AI suggests a category and records for each document, every suggestion quoting its page, and nothing reaches the case until it's approved on the Import review screen. See Bulk Case Import.
CategoriesAbout 470: every C-form and supplement, FL401–FL415, FGM001, FL701, divorce (D8, D84, D36, D11, D81, D50K), financial remedy forms, appeals (FP161, FP162, N161), EX107, PRA agreements, orders, hearings, public law, adoption and SGO, experts, police, health, education, identity, legal aid and costs, mediation, international, legal research and working papers. Find by any word or form code; sort grouped, A–Z or busiest first.
Case managementCase & hearings (countdowns, preparation checklists, register of orders), directions & tasks with overdue warnings, a deadline calculator aware of England & Wales bank holidays and FPR "clear days", contact log with attendance statistics, costs & expenses, Scott schedule, children's dates of birth, parties, and a timeline with location, people present and police/incident references. The dashboard shows the next hearing, overdue items, contact attendance and the next two weeks.
Letters & statementsLive-preview editor with fields filled from the case details. UK templates: letter to the court, witness statement (with statement of truth), position statement, case summary, letter to Cafcass, subject access request, formal complaint, letter to an MP, transcript request, adjournment request, without-prejudice proposal and chasing a direction. Letterheads in three styles, or import a Word letterhead/template (.docx/.dotx). Export to Word, PDF or HTML with no author names or Windows details.
ProducePaginated PDF court bundles with cover, index and sections A–F (PD 27A style); chronology and summary reports for complaints or MP letters.
HelpHelp assistant: ask in your own words and get step-by-step directions with buttons that go straight there (uses local AI with a map of the app; only the question is sent to the model, never the case; works more simply without AI). UK Family Law Guide & FAQ with a glossary. Screen readers can read every screen.
Optional AI (Ollama)Summaries, chronologies, issues and allegations, inconsistencies, welfare-checklist mapping, safeguarding concerns and questions to consider, over the whole case, chosen documents, a category, a party, a date range or records. Granular mode for large sets. Bulk analysis with a fast built-in default model (gemma3:4b), Fast and Careful presets and settings matched to the PC's hardware (see AI speed & hardware). Editable prompts; GPU/CPU, threads, context and keep-alive settings. Off by default, local by default; remote servers must be allowed explicitly and use HTTPS.
Security & auditPassword protection encrypts documents, the database, snapshots and saved exports. Auto-lock on inactivity, Windows lock or Ctrl+L; one-click Maximum security. Hash-chained audit trail of every change (old and new values) that can be verified and exported. Error log with a reference on every message; logs never contain case content or the Windows user name. Decrypted temporary copies are wiped on close.
Data safetyDaily database snapshots, document integrity check, start-up health check, encrypted backups and merges that carry every record type and settings, a settings & templates file to move between PCs, several case libraries, and performance profiles (desktop vs laptop on battery).

Release notes for every version are on the Software page and in CHANGELOG.md in the source.

System requirements

ComponentRequirement
Windows64-bit Windows 10 version 1809 (build 17763) or newer, or Windows 11
Architecturex64 only
Disk≈ 250 MB for the program, plus the documents you import
RuntimeNone — .NET 8 is bundled (self-contained)
Windows featuresUses the built-in Windows OCR (Windows.Media.Ocr) and PDF renderer (Windows.Data.Pdf). OCR needs an installed OCR language pack (English is present on English installs).

Installing & silent deploy

The installer (CaseKeeper-Setup-v0.8.0.exe) is built with Inno Setup. By default it installs per-machine to C:\Program Files\DarkCipher Systems\CaseKeeper; users without admin rights can choose a per-user install from the elevation dialog.

# Silent per-machine install (run elevated)
CaseKeeper-Setup-v0.8.0.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

# With a log file and a desktop shortcut
CaseKeeper-Setup-v0.8.0.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /TASKS="desktopicon" /LOG="%TEMP%\CaseKeeper-install.log"

# Custom install folder
CaseKeeper-Setup-v0.8.0.exe /VERYSILENT /SUPPRESSMSGBOXES /DIR="D:\Apps\CaseKeeper"

# Per-user install, no admin rights needed
CaseKeeper-Setup-v0.8.0.exe /VERYSILENT /SUPPRESSMSGBOXES /CURRENTUSER
SwitchEffect
/SILENT · /VERYSILENTProgress only · no UI at all
/SUPPRESSMSGBOXESAuto-answers message boxes
/NORESTARTNever restart (CaseKeeper doesn't need one)
/DIR="…"Install folder
/TASKS="desktopicon"Create a desktop shortcut
/CURRENTUSER · /ALLUSERSForce per-user or per-machine
/LOG="file"Write a setup log

The app doesn't auto-launch after a silent install (skipifsilent). If CaseKeeper is running during an upgrade, setup closes it automatically.

Upgrades & uninstall

  • Run a newer installer over the old one — it recognises the existing install by AppId and upgrades in place.
  • Upgrades never touch user data. Documents, notes, timeline, complaints and settings live outside the program folder.
  • In-app updates (website version, since 0.5.0): Settings → Updates checks https://darkciphersystems.com/downloads/casekeeper/update.json, offers an update only when both of its signatures (ECDSA P-256 and ML-DSA-65) verify against the keys built into the app, and runs the same setup program after a backup prompt. Automatic checks are off by default. Managed estates can keep deploying the installer silently instead. The Microsoft Store version is updated by the Store.
# Silent uninstall (per-machine)
"%ProgramFiles%\DarkCipher Systems\CaseKeeper\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
Data is kept on uninstall. Only the program folder is removed, and a silent uninstall never deletes data. An interactive uninstall asks whether to delete the library too (No is the default). To remove a user's data on purpose, use Settings → Factory reset → Remove all CaseKeeper data… in the app (it lists what will go, offers a backup and asks for DELETE), or delete %LOCALAPPDATA%\CaseKeeper (or the custom library folder) and %APPDATA%\CaseKeeper by hand — after confirming they have a backup.

Data locations

PathContents
%LOCALAPPDATA%\CaseKeeperDefault library root
…\casekeeper.dbSQLite database with FTS5 search index (SQLCipher-encrypted when password protection is on)
…\Files\Copies of imported documents (AES-256-GCM encrypted when protected)
…\Exports\Generated bundles, reports and chronologies
…\vault.jsonWrapped key material — present only when password protection is on; useless without the password
…\.casekeeper-in-use.json"Library in use" marker while the app is open (see network libraries)
%APPDATA%\CaseKeeper\library-location.jsonRemembers a library moved or opened from a custom folder

Library placement

The library location is resolved in this order:

  1. CASEKEEPER_LIBRARY environment variable, if set — useful to force the library onto an encrypted drive via policy.
  2. The folder saved in library-location.json (set by Settings & Backup → Your library).
  3. The default, %LOCALAPPDATA%\CaseKeeper.
# Per-user, persistent
setx CASEKEEPER_LIBRARY "E:\SecureVault\CaseKeeper"

In the app:

  • Move library copies everything, verifies every file byte-for-byte, checks the database opens, and only then deletes the originals. Any failure leaves the original untouched.
  • Use a different library… opens an existing library elsewhere without copying anything; choosing an empty folder starts a new library there.
  • If the library can't be reached at startup, CaseKeeper offers to retry or pick another folder — it never silently recreates an empty library in a folder you chose.

Network & shared libraries

A library can live on a NAS or SMB share, and several PCs can point at the same folder — one at a time.

  • On network paths the database switches from WAL to the rollback journal (journal_mode=DELETE), because WAL needs shared memory that SMB doesn't provide.
  • While open, CaseKeeper writes .casekeeper-in-use.json (machine, user, process, timestamps), refreshed every minute. Another PC opening the same library is warned first.
  • A marker left by a crash or dropped connection goes stale after 3 minutes and stops counting.
Don't write from two PCs at once. SQLite over a network share isn't safe for concurrent writers. Keep the share connected while the app is open.

Password protection

  • Turn on under Settings & Backup → Password protection. Every document file and the entire database (notes, OCR text, search index, timeline, complaints) is encrypted at rest with AES-256.
  • Documents are decrypted only in memory — viewing, searching, OCR and bundle building never write a readable copy to disk.
  • Changing the password is instant (only the wrapping key changes). Protection can be turned off again.
  • There is no recovery. A lost password means permanently unreadable data — there's no admin override or escrow. Keep backups.
Defence in depth: combine password protection with BitLocker on the device. Backups are readable by design (so they restore on any machine) — protect them with a backup password.

Backup & restore

  • Settings & Backup → Create backup writes one .zip with the database and every document, optionally AES-256 encrypted.
  • If the library is protected and the backup isn't, CaseKeeper warns and offers to add a password.
  • Import either adds to the current library (duplicates skipped; safe to repeat) or replaces everything (disaster recovery / new PC).
  • Factory reset sits behind a typed confirmation and an offer to back up first.

For scheduled protection, back up the library folder with your normal file-backup tooling while CaseKeeper is closed (an open database may be mid-write), or use the in-app backup.

Bulk Case Import

New in v0.4.0. Brings a whole case folder, with all its subfolders, into the library in one job. Start it from Import folder on the Documents screen, Import a whole folder on the Dashboard, Ctrl+Shift+I or the command palette.

  1. Scan and preview (nothing changes yet). It shows how many files were found, which will be imported, duplicates, unsupported types and anything unreadable, with the total size. Untick single files or whole folders, filter, search, and copy a summary (counts and paths inside the folder only).
  2. Import. Each file goes through the normal import, so it's encrypted when the library is protected, fingerprinted (SHA-256) and audited.
  3. Read text. Windows OCR and Word/text extraction, in the background.
  4. Analyse (optional, local AI). A suggested category and records for each document.
  5. Cross-check. Plain rules across all the documents (below), then everything waits on the Import review screen.
BehaviourDetail
OriginalsNever moved, renamed or changed, and nothing is written into the folder being imported.
Skipped by defaultHidden files and folders, temporary and system files (Thumbs.db, Office lock files). Shortcuts and linked folders aren't followed unless asked; folder loops are always detected. Long Windows paths work. Unreadable folders and files are reported and the rest carry on.
DuplicatesMatched by contents (SHA-256) against the library and within the folder, never by name. Skip (noting the matching document), import anyway, or decide one by one. Two different files with the same name are both imported.
Folder structureEach document keeps its path inside the chosen folder (never the full Windows path), shown in its details and under By original folder in the Library tree. Folder names can become tags, or each top-level folder can map to a category; the mapping is shown before anything happens.
File datesKept for information only. A file's modified date is never used as the document's date.
Pause and resumeProgress is saved after every file, so a job survives pause, stop, a crash or closing the app; the Dashboard offers to carry on. Only one job runs at a time. A time estimate appears only once it can be measured.
Supported typesThose of the normal import: PDF, Word .docx, images and text. Others (.doc, .xlsx, .msg, .eml, .zip…) are listed as unsupported.
LimitsUp to 50,000 files and 64 folder levels per job. PDFs are read with Windows OCR, not from an embedded text layer.

What the AI may suggest

With AI enabled (the local Ollama by default, where nothing leaves the PC or network; or, since v0.6.0, a cloud AI the user chooses, masked by default), each document can get a category and suggested records: hearings, orders, directions and deadlines, tasks, timeline and chronology entries, contact, parties and children, complaints, safeguarding concerns and documents referred to but missing.

  • Short list of categories. CaseKeeper narrows its ~470 categories to 10 candidates using form codes, file-name rules, headings and shared words. The AI can only pick one of those or Unknown. A low-confidence pick becomes Uncategorised (needs review), with the guess kept.
  • Strict, validated answers. The AI must answer in a JSON Schema (Ollama structured outputs), at temperature 0, and CaseKeeper validates the answer itself. A bad answer is retried once, then reported with a safe code, never guessed at.
  • Traceable. Every suggestion quotes the words it relies on and their page. A quote not found on that page is flagged and its confidence capped. Dates must actually be written in the document (UK day-first; ambiguous all-number dates are flagged), and names the document doesn't contain are dropped.
  • Dates keep their meaning. Issued, listed for (which doesn't mean it took place), adjourned, vacated, alleged, deadline and so on. Month- or year-only dates keep that precision.
  • Deadlines are never calculated by the AI. Wording such as "within 14 days" is worked out by the existing deadline calculator from a start date and rule the person confirms, and the explanation is saved with the task.
  • Allegations are recorded as what someone states, never as fact.
  • Long documents are read in parts of whole pages and the findings merged, keeping page ranges.
  • No re-analysis unless the document, prompt, model or format changes, or the person asks. Existing documents can go through the same process: right-click → Analyse with AI → Organise.
  • The instructions are editable in Settings → AI → Prompts → Bulk Case Import.

Cross-checks (rules, not AI)

The same event in several documents; a hearing given different dates; hearings later adjourned or vacated; different case numbers (documents that may belong to another case); names spelt differently; suggestions already in the case; directions a later order may have replaced; hearings and deadlines within 14 days; gaps of six months or more in the chronology. Conflicts are shown side by side and nothing is changed automatically.

When the AI isn't available

SituationWhat happens
AI off, or Ollama not reachable at the startThe import still completes. CaseKeeper's own rules suggest categories from form codes, and documents wait as awaiting AI to be analysed later with one click.
Ollama lost mid-runBounded retries (2 s, 5 s, 12 s), then the rest wait for later.
TimeoutOne retry, then that document is marked failed and the job carries on.
Source file gone after the scanMarked missing; the rest continue.
A file changes while being importedThe fingerprint is taken from the stored bytes; a mismatch with the scan fails that file. A failed import never leaves an orphaned copy (true of every import from v0.4.0).

Import review

A screen in the sidebar under Papers. It lists every suggestion by type, with filters for confidence, document, dates and warnings, and a summary of each import. Nothing the AI suggests reaches a case record or a document's category until the person approves it.

  • Each suggestion shows its source document, page and quoted words (Open at page), what the date means, who says so, the confidence in plain English and why, any warnings, and other documents to compare with.
  • Actions: Approve, Edit & approve (the same form as adding it by hand), Reject, Defer, Reconsider, and Undo for approvals. Several categories can be approved at once. A warning appears before adding something that looks like an existing record.
  • Approvals go through the normal rules (a hearing also gets its timeline entry, and so on) and are audited as AI-suggested and approved by the user, with the model and prompt version.
  • Rejected suggestions keep no quoted text or detail.
  • Confidence thresholds and the longest document read in full are adjustable in Review options.
Auto-apply is off by default. An advanced option can file documents under the AI's category when it's very confident (threshold 0.95, never below 0.85). It applies to categories only, only for documents still in Uncategorised, and is audited, listed separately and reversible. It never creates any other record.

AI speed & hardware

Bulk analysis uses gemma3:4b by default: quick and reliable at structured answers. If it isn't installed, Review options offers to download it (about 3 GB, only when asked, and audited). Two presets: Fast (recommended) and Careful, which uses a larger model such as qwen3:14b only when the graphics card can hold it, and says so otherwise.

CaseKeeper sorts the PC into a tier from graphics memory, system memory and power source. Detection reads the display adapter's memory size from the registry and the power state; nothing is sent anywhere. Review options shows "This PC: …" with a Use recommended settings button.

TierWhenDocuments at onceReadingCareful model
MinimalNo usable graphics card and under 8 GB memory1Categories only; AI off by default—
BasicA basic PC, or any PC on battery / power saver1Categories and document details only—
MidGraphics card ≈ 6–10 GB2FullUp to 8B, if it fits
HighGraphics card 12 GB or more3Fullqwen3:14b class
Very highGraphics card 24 GB or more4FullUp to 32B class
  • Fits: a model fits when it's at most 85% of graphics memory, or 45% of system memory (CPU, slow). Larger models are marked "too large for this PC".
  • Several at once only helps when Ollama allows parallel requests (OLLAMA_NUM_PARALLEL on the Ollama host).
  • Thinking models (qwen3, deepseek-r1, gpt-oss and similar) have thinking switched off or set low for bulk analysis. Output is capped (2,048 tokens, 12 findings per part).
  • Less work for the AI: photos with little text get a quick reading (category and description only). In a quick reading, a document whose form code settles the category for certain isn't sent to the AI at all; its suggestion still waits for approval and is never auto-applied. Basic and Minimal PCs read in smaller parts.
  • Automatic step-down: if Ollama runs out of memory, a part times out twice, or under 90% of the model sits on the graphics card, CaseKeeper eases off one step at a time: one document at a time → half-size parts → a lighter installed model → quick reading. It reports what it changed and records it in the audit trail. Each document is tried at most three times.
  • The user's choices win: model, speed, reading depth and documents at once can all be set by hand, with a warning if the PC can't sensibly run them. On first connecting in Settings → AI, gemma3:4b becomes the AI model only if it's installed and none was chosen.
Setting keyMeaning
bulk.presetfast or careful
bulk.modelModel name; empty = recommended
bulk.depthauto, full or categories
bulk.aiWorkersDocuments at once, 1–4; empty = this PC's tier
bulk.high · bulk.mediumConfidence thresholds
bulk.maxPartsLongest document read in full, in parts
bulk.autoApply · bulk.autoApplyThresholdOff · 0.95 (never below 0.85)
bulk.optionsRemembered wizard choices
prompt.bulk.analyseThe editable bulk analysis prompt

Privacy & security

  • No network use unless you ask. No account, telemetry or cloud OCR; text recognition uses the engine built into Windows. Internet connections happen only when the user asks: the update check in the website version, made when the user clicks Check for updates or switches on automatic checks, which downloads update.json and its two signatures (and the setup program, if the user chooses to update) from darkciphersystems.com, with a generic User-Agent and no cookies or identifiers; and a cloud AI, if the user chooses one (below).
  • The local AI talks only to the configured Ollama server (local by default; a remote one must be allowed and use HTTPS). Model downloads happen only when the user presses the button.
  • Cloud AI (optional, off by default, since v0.6.0). In Settings → AI the user can choose Anthropic, OpenAI, or Claude or OpenAI on their own Microsoft Foundry resource. Only then is the text of the documents they ask it to analyse sent, over HTTPS (TLS 1.2 or 1.3), to api.anthropic.com, api.openai.com or their own Foundry resource, never anywhere else, with redirects never followed, no cookies and no settings taken from environment variables. Names, contact details, ID numbers, dates of birth and addresses are masked by default, and nothing is sent without the user's agreement, checked again at the moment of sending. Keys are the user's own, encrypted for their Windows account, and never written to logs, the audit trail, exports, settings files or backups. Maximum security switches cloud AI off, and importing a settings file or merging a library can never choose a cloud AI, add a key or a Foundry resource, turn masking off or agree to sending.
  • Case memory (since v0.8.0). A summary of the case built from the user's records, plus what CaseKeeper has learnt from their decisions, stored only in the library database on the user's PC: encrypted with everything else when the library has a password, included in backups and deleted with the library. It never contains anyone's contact details; for children it holds a year of birth only. A short case background from it is sent with each document the AI reads, so names stay consistent: with the local AI nothing leaves the PC; with a cloud AI it is sent only after the user agrees on the pre-send review, masked when masking is on. It can be switched off on the Case memory screen.
  • Questions about the case (since v0.8.0). With a cloud AI, the question, the case memory and the matching document extracts go only to the provider the user chose, with the same consent and masking. The audit trail records counts only, never the question.
  • Automatic additions (since v0.8.0). Whatever the AI adds to the case is marked From AI · check and listed for review; it can be undone, anything undone is never added again, and it can be switched off. Document versions and importance are worked out on the PC: nothing is sent, renamed or deleted.
  • Original files are never moved or modified — they're copied into the library and fingerprinted for duplicate detection.
  • Bulk import writes no decrypted temporary files. Its log entries hold only ids, stages, counts and safe codes — never document text, titles, file names or paths — and the audit trail records the imported folder's name, never its full path.
  • Sharing uses the Windows Share sheet, behind a confidentiality reminder.
  • Library data is sensitive family-court material. Avoid cloud-synced folders unless that's intended, and apply appropriate retention.

Identifiers

ItemValue
Inno Setup AppId{B6E4A1D7-3F28-4C5B-9A07-5E1C8D42F093}
Uninstall registry keyHKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{B6E4A1D7-3F28-4C5B-9A07-5E1C8D42F093}_is1 (HKCU for per-user installs)
ExecutableCaseKeeper.exe
Default install folder%ProgramFiles%\DarkCipher Systems\CaseKeeper
Publisherdarkcipher0x

Detection rule: the uninstall key's DisplayVersion, or the file version of CaseKeeper.exe.

Code signing & Smart App Control

The installer and app are not code-signed today.

  • Smart App Control is off on enterprise-managed devices, so it won't block managed deployments.
  • For App Control for Business / AppLocker, allow by hash or path (%ProgramFiles%\DarkCipher Systems\CaseKeeper\*); refresh hash rules each release.
  • Verify downloads with the published SHA-256, or build from source and sign with your own certificate (add a SignTool line to installer\CaseKeeper.iss).

Home-user guidance: Managing Smart App Control.

Troubleshooting

ProblemSolution
"Windows protected your PC"More info → Run anyway (unsigned installer). See signing.
Installer refuses to runRequires 64-bit Windows 10 1809+; check architecture and build
Scanned text isn't searchableInstall a Windows OCR language pack for the document's language (Settings → Time & language → Language)
"Library in use" warningAnother PC has it open. Close it there, or wait 3 minutes if that PC crashed
Library can't be found at startupReconnect the drive/NAS and choose Retry, or open a different folder
Database errors on a network shareEnsure only one PC uses it; keep the share connected; restore from backup if damaged
Forgotten passwordNot recoverable. Restore from an unprotected or known-password backup
Bulk import: documents "awaiting AI"Ollama was off or unreachable. Start it, check Settings → AI, then analyse the waiting documents with one click
Bulk analysis is slow, or says it stepped downPress Use recommended settings in Review options; use the Fast preset; on a laptop, plug in. Set OLLAMA_NUM_PARALLEL for several documents at once
Careful preset uses the Fast modelThe larger model doesn't fit this PC's graphics card. Expected
Files listed as unsupportedConvert .doc/.xlsx/emails to PDF or .docx first
Data missing after reinstallCheck CASEKEEPER_LIBRARY and %APPDATA%\CaseKeeper\library-location.json point at the right folder

Developers

Dev environment

ToolWhyInstall
.NET 8 SDKBuilds the WPF appwinget install Microsoft.DotNet.SDK.8
Inno Setup 6Builds the installerwinget install JRSoftware.InnoSetup
GitSource controlwinget install Git.Git
GitHub CLIOptional — one-line releaseswinget install GitHub.cli

Get the code from the Source Code page.

Building

# Debug build and run
cd CaseKeeper
dotnet build
dotnet run

# Release installer → dist\CaseKeeper-Setup-v<ver>.exe
cd ..
powershell -ExecutionPolicy Bypass -File build-release.ps1

build-release.ps1 publishes self-contained for win-x64 into publish\, compiles installer\CaseKeeper.iss, and prints the installer path, size and SHA-256. It warns if CHANGELOG.md has no entry for the version being built. The installer's version is read from the built exe, so it can never disagree with the app. Release builds contain no debug symbols or local paths (see Release process).

Project layout

PathWhat's there
CaseKeeper/Models/Documents, categories, parties, events, complaints
CaseKeeper/Data/Database (SQLite + FTS5) and DefaultCategories (≈125 England & Wales family-court categories)
CaseKeeper/Services/Library, OCR, PDF rendering, bundles, backup, vault, share, library lock
CaseKeeper/Views/WPF windows and dialogs; MainWindow split into .Documents, .Records, .Bundle partials
CaseKeeper/UI/Converters, natural sort, theme manager
CaseKeeper/Themes/Light and dark palettes
installer/Inno Setup script and pre-install notice
.github/workflows/Tag-triggered release workflow
build-release.ps1, RELEASING.md, CHANGELOG.mdRelease tooling and notes

Data model

A single SQLite file, casekeeper.db, in the library folder. WAL journal locally, rollback journal on network paths.

TablePurpose
CategoriesBuilt-in and custom categories, with bundle section
DocumentsImported files: metadata, category, party, fingerprint, star
PageTextOCR / extracted text per page
PageNotesUser notes per page
PartiesPeople and organisations in the case
EventsTimeline / chronology
Complaints, ComplaintDocumentsComplaint log with references, due dates and linked documents
SettingsKey/value app settings
ImportJobs, ImportFiles, AiFindingsBulk import working tables (v0.4.0): one row per job, per scanned file and per suggestion. Encrypted, snapshotted and backed up with the library, but not carried by backup merges
SearchIndexFTS5 virtual table over metadata, page text and notes (source: meta, page, notes, pagenote)

User search input is converted into a safe FTS5 query (every word must appear, prefix match; quoted phrases match exactly).

Encryption design

password ──PBKDF2-HMAC-SHA256 (600,000 iters, random salt)──▶ wrapping key
wrapping key ──unwraps──▶ random master key
master key ──▶ AES-256-GCM for every document file   (nonce 12 | tag 16 | ciphertext)
master key ──▶ SQLCipher passphrase for casekeeper.db
  • Implemented in Services/Vault.cs; key material in vault.json (salt, iterations, wrapped key, verifier).
  • Changing the password only re-wraps the master key — no document re-encryption.
  • GCM authenticates as well as encrypts, so tampered files fail to decrypt rather than returning garbage.
  • SQLCipher comes from SQLitePCLRaw.bundle_e_sqlcipher.

Services

ServiceResponsibility
LibraryServiceResolves the library root (env var → saved location → default), import, move, open-elsewhere
LibraryLock"In use" marker for shared libraries (1-minute refresh, 3-minute staleness)
OcrServiceWindows.Media.Ocr text recognition
PdfRenderServiceWindows.Data.Pdf page rendering for the viewer and OCR
BundleServicePD 27A-style paginated bundles and summary reports (PDFsharp)
BackupServiceZip backups (optional AES-256), add/replace import, merge
VaultPassword protection and key management
ShareServiceWindows Share sheet integration
BulkImportServiceThe single orchestrator for Bulk Case Import (one job at a time)

Bulk import design

The full architecture is in docs/BULK-IMPORT.md in the source. In short:

folder ─▶ FolderScanner.Scan ─▶ FindDuplicates (SHA-256) ─▶ BulkImportService.PreviewRows
                                                     │ user reviews, ticks, maps
CreateJob ─▶ ImportJobs + ImportFiles  (audited: bulkimport.start)
RunAsync  ─▶ 1 Import   LibraryService.Import (Uncategorised or the folder mapping)
          ─▶ 2 Text     LibraryService.ProcessTextAsync (bounded by the performance profile)
          ─▶ 3 Analyse  CategoryMatcher.Candidates ─▶ Ollama structured output
                        ─▶ AnalysisSchema.Parse ─▶ provenance + date checks ─▶ AiFindings
          ─▶ 4 Check    FindingChecks.Run (deterministic cross-document rules)
Review    ─▶ ImportReviewView ─▶ FindingApprover.Approve / Reject / Defer / Undo / Reconsider
  • Reuse, don't duplicate. Files go through LibraryService.Import, approvals through the same Database calls and edit forms the screens use, hearing timeline entries through HearingSync, deadlines through Deadlines.Calculate.
  • Working tables are [Entity] classes like the record tables (columns added on upgrade, never removed), written with SaveQuiet, with meaningful events audited explicitly. They're not in Database.RecordTypes, so merges don't import another library's suggestions. Database.CheckStaging tidies rows pointing at deleted documents.
  • New Documents columns: SourcePath (path inside the chosen folder, never the full path) and SourceModifiedAt (information only).
  • AI contract: AiService.ChatJsonAsync with a JSON Schema from AnalysisSchema.Build (JSON mode on older servers; validated either way), temperature 0. Category ids are an enum of the candidate keys K1…Kn or UNKNOWN, so an invented id is impossible or rejected. Failures get safe codes (AI_INVALID_JSON, AI_SCHEMA, AI_BAD_CATEGORY, AI_TIMEOUT, AI_OVERLOAD, AI_OFF, AI_UNAVAILABLE, AI_STEPPED_DOWN).
  • Re-analysis is keyed on DocumentAnalyzer.InputFingerprint: content hash, page text, prompt hash, schema and analysis versions, model and part size. New results mark undecided suggestions Superseded, never deleted.
  • Hardware tiers live in Services/Ai/AiHardware.cs; step-down in BulkImportService.AnalysisPhaseAsync.
  • Privacy: no decrypted temporary files; AppLog entries carry ids, stages, counts and safe codes only; only the exception type is logged.

Dependencies

PackageVersionUse
Microsoft.Data.Sqlite8.0.10Database access
SQLitePCLRaw.bundle_e_sqlcipher2.1.10SQLCipher-enabled SQLite native library
PDFsharp-WPF6.1.1Bundle and report PDFs
SharpZipLib1.4.2Zip backups with AES

Target framework net8.0-windows10.0.19041.0, minimum OS 10.0.17763.0, self-contained win-x64.

Release process

  1. Bump the version in CaseKeeper/CaseKeeper.csproj — Version, AssemblyVersion, FileVersion and InformationalVersion must agree. Patch for fixes, minor for features, 1.0.0 when stable.
  2. Write patch notes at the top of CHANGELOG.md (## v0.4.0 — date, then Added / Fixed).
  3. Build: powershell -ExecutionPolicy Bypass -File build-release.ps1.
  4. Test the upgrade on a machine with the previous version and confirm documents survive.
  5. Commit and tag: git tag v0.4.0, git push origin main --tags.
  6. Privacy check (see below), then publish the installer with its SHA-256 in the release notes.

Privacy rules for every release (0.2.2+)

  • CaseKeeper.csproj sets DebugType=none, DebugSymbols=false, Deterministic and a PathMap, so the installer carries no .pdb files and the program contains no build-machine folder paths. Don't remove these.
  • Never test or demo with real case papers. Use dummy documents, made-up names and generic paths in screenshots, bug reports and examples.
  • Before publishing, check publish\ (what the installer packs) for user names, user-profile folder paths, email addresses and .pdb files.
Never change the AppId in installer\CaseKeeper.iss — it's what lets a new version upgrade an old one instead of installing alongside it.

GitHub Actions

.github/workflows/release.yml runs on windows-latest whenever a v* tag is pushed (or manually):

  1. Sets up .NET 8 and installs Inno Setup via Chocolatey.
  2. Runs build-release.ps1.
  3. Fails if the tag doesn't match <Version> in the project file.
  4. Creates a draft GitHub release with CHANGELOG.md as the body and the installer attached.

Contributing

  • MIT-licensed — fork, modify and redistribute with the copyright and licence notice intact.
  • Keep it local-first: no network calls except the ones the user chooses (AI, model downloads, update checks), no telemetry, never modify a user's original files.
  • Never test with real case documents in bug reports — use dummy files.
  • Questions or patches: email or Discord.