Skip to content

Add full audit export: JSON, SQLite, and PDF - #12

Merged
ali-ulu merged 2 commits into
mainfrom
claude/remove-demo-data-xdwh4x
Jul 29, 2026
Merged

Add full audit export: JSON, SQLite, and PDF#12
ali-ulu merged 2 commits into
mainfrom
claude/remove-demo-data-xdwh4x

Conversation

@ali-ulu

@ali-ulu ali-ulu commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Product Hunt feature request: a way to audit/back up the full graph data — entities, trust scores, conflict candidates — not just raw memories.
  • The existing "Data Management" export and "Backup & Restore" only ever covered memories (+ sessions for backup); the entity graph, trust scores, and conflict candidates were only reachable via individual paginated REST reads, no one-shot export.
  • Adds server/core/full_export.py with one data-gathering pass (build_full_export) shared by three outputs:
    • GET /api/export/full.json — raw machine-readable bundle (memories + entities + trust + conflicts)
    • GET /api/export/full.sqlite — a consistent copy of the live DB via SQLite's online backup API (reuses Database.create_safety_backup, so WAL pages are captured correctly)
    • GET /api/export/full.pdf — human-readable summary report (new optional dependency fpdf2, added as the pdf extra so core installs stay light; a clear error is raised if it's missing, JSON/SQLite work without it)
  • New CLI command: levh export-full --format {json,sqlite,pdf} [--out PATH]
  • New Settings → Data Management buttons for all three formats
  • TrustService.list_all_trust() / Database.list_all_trust() added to fetch every stored trust breakdown (the existing list_low_trust is threshold-filtered only)

Test plan

  • python -m pytest tests/test_full_export.py tests/test_backup.py tests/test_entity_graph.py -q — 37 passed
  • python -m pytest tests/ -q — full suite, 603 passed
  • levh export-full --format json/sqlite/pdf manually verified against a live local DB — SQLite output opens as a valid DB, PDF starts with %PDF-
  • npm run build (Next.js static export) succeeds

Generated by Claude Code

claude added 2 commits July 29, 2026 14:00
Product Hunt feature request: a way to audit/back up the full graph
data (entities, trust scores, conflict candidates), not just memories.
The existing "Data Management" export and "Backup & Restore" only ever
covered memories (+ sessions for backup) — the entity graph, trust
scores, and conflict candidates were only reachable via individual
paginated REST reads.

Adds server/core/full_export.py with three outputs sharing one data
pass (build_full_export):
- GET /api/export/full.json — raw machine-readable bundle
- GET /api/export/full.sqlite — a consistent copy of the live DB via
  SQLite's online backup API (Database.create_safety_backup)
- GET /api/export/full.pdf — human-readable summary report (fpdf2,
  optional dependency, added as the `pdf` extra)

Also: `levh export-full --format {json,sqlite,pdf}` CLI command, three
buttons in Settings -> Data Management, and TrustService.list_all_trust
to fetch every stored trust breakdown (not just below-threshold ones).
CI installs pip install -e ".[dev]" only; the PDF export test needs
fpdf2, which was previously only in the separate `pdf` extra and never
installed in CI.
@ali-ulu
ali-ulu merged commit d838587 into main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants