kb/ is its own wiki root: 34 pages across 7 categories, index.md catalog, log.md, AGENTS.md schema layer, and raw/ holding copies of README, the spec, the 13-task plan, the design master and the SDD ledger. Every page cross-references 3 to 6 others and all 107 wikilinks resolve except two [["list"]] artefacts inside JSON snippets in the copied plan. Kept separate from the repository root on purpose: its generated graph lands in kb/.ua/ instead of overwriting the code graph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
875 B
875 B
SQLite schema
lib/db.ts uses node:sqlite — no ORM, no driver, no native build. Four tables:
users— id, unique email,salt:hashscrypt password, created_atsessions— hashed token, user id, expirysettings— one row per user: analyst base URL, model, sealed key, extra JSON, Jev key, Jev model, email, onboardedanalyses— id, user id, title, raw XML, oul, verdict JSON, status, error, timestamps
patchAnalysis only accepts keys from a PATCHABLE whitelist, because building SET clauses straight from object
keys is how an object key becomes SQL.
The saveSettings upsert uses COALESCE(NULLIF(excluded.analyst_key, ''), settings.analyst_key) so that a form
submitting a blank secret keeps the stored one. Blank means "unchanged", never "clear".
Related: Lazy database open, Analysis row lifecycle, Credential vault.