Skip to content
pi-c View Ticket
Login

View Ticket

Storage: ctx export as picu_pi_session_line rows, sqlar-compressed

Closed467ff3edef35c5483b03da383a30e830c7b8ad38Created 11.3 days agoUpdated 11.1 days ago
Description2026-11-19 15:56:17
Write the Pi v3 session lines into picu_pi_session_line(conversation, seq, workspace, sz, line) in ~/.pic/pic.sqlite instead of ~/.pic/sessions/*.jsonl. Same lines, append-only, line deflated when smaller (sqlar rule: sz = length(line) means raw). Register sqlar_compress/sqlar_uncompress (SQLite ext/misc/sqlar.c, vendored zlib).

- ctx reads the rows instead of files: ticket in ctx's context project (filed with this one). - pic export --pi DIR still writes files when asked (explicit output), with - for stdout. - Keep writing the files until ctx reads the rows, then stop.

Done when: ask/chat/TUI requests append rows; ctx archives from them; no automatic files remain.

Plan: https://artifacts.craftdesign.group/v/-DvLRzrfEh1mIldmhMgfG#06c5bdb18c04b6b8d28d045ed9812ef5c91f2f85f57c6feb26b574cb21cec0ef (section 2)

2026-11-19 17:24:49
Landed in 9304258f7da1: rows of picu_pi_session_line in ~/.pic/pic.sqlite (sqlar-compressed, append-only, kind and entry columns), --pi - to stdout. The ~/.pic/sessions files are still written until ctx ticket ff2b3f5b83 lands; then flip piSessionFiles off by default and close this ticket.
2026-11-19 19:34:21
Landed in 06ac29aa0555: ctx reads the rows (ctx ff2b3f5b83, verified on real data), so the files are off by default (piSessionFiles=1 keeps them). Journal version 7 fills in missing times for old entries.