Provenance & Storage
The data layer is SQLite + local files only, with no multi-process / multi-machine deployment path. This page covers the storage layout, auth & encryption, and the provenance ledger that makes "every conclusion leads back to its source" true.
Storage layout
~/.interviewforge/
system.db profiles · profile_tokens · audit · providers · capability_routes · models · mcp_servers …
shared.db shared_collections/documents/chunks/versions/acl/audit
keys/master.key AES-256-GCM master key (encrypts provider keys)
profiles/<id>/
app.db sessions · events · runs · checkpoints · interrupts · tool_calls · kb_* · resumes · memory_* …
lineage.db calls · claims · nodes · edges · payloads- Per-profile directory & DBs:
app.dbholds sessions and the private KB;lineage.dbholds the provenance ledger. - WAL mode: better-sqlite3 runs in WAL so reads and writes don't block each other; FTS5 provides full-text indexing.
- Machine-shared but encrypted: provider keys live in
system.db, encrypted with AES-256-GCM usingkeys/master.key; the API returns onlyhasKey, never plaintext.
Authentication
| Mechanism | Description |
|---|---|
| PIN | scrypt hash + salt; the profile creation response contains no pin_hash / pin_salt |
| Profile token | HMAC-signed, carries ver / jti, rotatable & revocable; the frontend sends it as Bearer |
| Lock / unlock | /profiles/:id/{unlock,lock,pin,reset-pin}; members can't rewrite capability routes or probes |
Data isolation (measured)
| Check | Result |
|---|---|
| New profile imports a private document | Visible to itself |
| Another profile reads that document list | Not visible |
| Another profile reads by session ID | 404 |
| File system | Each profile has its own profiles/<id>/{app,lineage}.db |
| Delete profile | Directory and DBs removed together, verified |
| Provider keys | Machine-shared but encrypted; API returns only hasKey |
The shared library is the exception to isolation, but constrained by ACL: use / edit / admin three-level permissions, revocation immediate, ownership transferable, operations recorded in an audit CSV.
The provenance ledger
Provenance isn't an afterthought log but an outbox → projection ledger:
- outbox: every model call, tool call and conclusion first writes an immutable record (
calls/claims/payloads). - projection: asynchronously projected into a graph (
nodes/edges) for/lineage/*queries and lineage-graph rendering. - Relation semantics:
SAW— which context/chunks a run saw;PRODUCED— which conclusion a call produced;CITES— which source chunk a conclusion cites.
Thus every conclusion can travel back to its source along PRODUCED → SAW / CITES. /citations/verify checks that citations really exist and match.
Report integrity
Report versions (report_versions) carry hash + HMAC + meta:
- Assembly has a single point,
report-builder.ts, shared by first score and rescore; - Derived fields are filled before computing hash and HMAC — any after-the-fact tampering breaks the signature;
ifg verify/verify-filecan offline-verify an exported report's integrity.
Export / import & cleanup
ifg exportexports redacted JSON / a package;ifg import <file.tar.gz>restores from a package (--forceoverwrites same-named data), round-tripping with export. In attached mode it prompts to restart the Host to load.ifg lineage gccleans orphan provenance records.- Retention:
/settings/retention+ a daily job (job_runs), retryable on failure;retention_overridesexempts specific objects.
Egress & audit
Local-first is not fully offline: storage stays on your machine, but with a real provider key configured, LLM inference (resume, KB chunks, questions, answers), voice, OCR, vision and web all send the corresponding content to the provider. The full boundary is in Introduction · What stays local, what leaves.
Egress records (egress) and cost (usage) make "what was sent to whom, and how much it cost" auditable: every egress writes a record (target host, data class, billing), queryable via /egress and /usage. This is transparency about the fact of "calling real providers" — data is stored locally, but inference content goes to whichever provider you configured.