Skip to content

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 ​

text
~/.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.db holds sessions and the private KB; lineage.db holds 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 using keys/master.key; the API returns only hasKey, never plaintext.

Authentication ​

MechanismDescription
PINscrypt hash + salt; the profile creation response contains no pin_hash / pin_salt
Profile tokenHMAC-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) ​

CheckResult
New profile imports a private documentVisible to itself
Another profile reads that document listNot visible
Another profile reads by session ID404
File systemEach profile has its own profiles/<id>/{app,lineage}.db
Delete profileDirectory and DBs removed together, verified
Provider keysMachine-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:

  1. outbox: every model call, tool call and conclusion first writes an immutable record (calls / claims / payloads).
  2. projection: asynchronously projected into a graph (nodes / edges) for /lineage/* queries and lineage-graph rendering.
  3. 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-file can offline-verify an exported report's integrity.

Export / import & cleanup ​

  • ifg export exports redacted JSON / a package; ifg import <file.tar.gz> restores from a package (--force overwrites same-named data), round-tripping with export. In attached mode it prompts to restart the Host to load.
  • ifg lineage gc cleans orphan provenance records.
  • Retention: /settings/retention + a daily job (job_runs), retryable on failure; retention_overrides exempts 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.

Local-first · inference egresses on demand · fully traceable