pi-c  Artifact [db0656cc90]

Artifact db0656cc90684ad4a58952d7edc772d141d86704890c21297244ed1eb3b8d97c:

  • File test/pic/journal-v3.sql — part of check-in [44df2d7337] at 2026-11-19 19:18:58 on branch pi-rows-only — Pi lines go to pic.sqlite only; old entries get their times; tests keep off the real HOME (ticket 467ff3edef)

    ctx now reads picu_pi_session_line, so ask, chat and the terminal stop writing ~/.pic/sessions files by default; piSessionFiles=1 brings them back. Journal version 7 fills in the times versions before 5 never wrote: an entry takes its request's start from the ask key, and a conversation its first entry's time when earlier, so exported lines no longer carry a null timestamp. Every test script now sets its own HOME, so running one outside make cannot touch the real ~/.pic. (user: dmestas, size: 2316) [annotate] [blame] [check-ins using] [more...]


-- A schema-3 journal as pic wrote it before the neutral form (2026-11-18):
-- one answered submission with a write call, its result and an answer.
-- test/pic/migrate.sh opens it with the current pic.
CREATE TABLE pic_meta(key TEXT PRIMARY KEY, value TEXT NOT NULL);
CREATE TABLE pic_submission(id INTEGER PRIMARY KEY, request_key TEXT NOT NULL UNIQUE, content TEXT NOT NULL,
  status TEXT NOT NULL CHECK(status IN ('admitted','answered','failed')), error TEXT);
CREATE TABLE pic_entry(seq INTEGER PRIMARY KEY, submission_id INTEGER NOT NULL,
  kind TEXT NOT NULL CHECK(kind IN ('user','assistant','tool_result','answer')), body TEXT NOT NULL, effect_id INTEGER);
CREATE TABLE pic_effect(id INTEGER PRIMARY KEY, entry_seq INTEGER NOT NULL, ordinal INTEGER NOT NULL,
  call_id TEXT NOT NULL, tool TEXT NOT NULL, input TEXT NOT NULL,
  replay_safe INTEGER NOT NULL CHECK(replay_safe IN (0,1)),
  state TEXT NOT NULL CHECK(state IN ('intent','started','done','unknown','skipped')), result TEXT,
  is_error INTEGER NOT NULL DEFAULT 0 CHECK(is_error IN (0,1)), plan BLOB, UNIQUE(entry_seq, ordinal));
CREATE TABLE pic_generation(id INTEGER PRIMARY KEY, submission_id INTEGER NOT NULL, turn INTEGER NOT NULL,
  attempt INTEGER NOT NULL, state TEXT NOT NULL CHECK(state IN ('started','done','failed')), entry_seq INTEGER,
  stop_reason TEXT, usage TEXT, request_id TEXT, error TEXT, UNIQUE(submission_id, turn, attempt));
INSERT INTO pic_meta VALUES('schema_version','3');
INSERT INTO pic_submission VALUES(1,'ask-1795035064-054753000-24954','make notes','answered',NULL);
INSERT INTO pic_entry VALUES(1,1,'user','make notes',NULL);
INSERT INTO pic_entry VALUES(2,1,'assistant','[{"type":"thinking","thinking":"Write it.","signature":"SIG-OLD"},{"type":"tool_use","id":"toolu_old","name":"write","input":{"path":"notes.txt","content":"hi"}}]',NULL);
INSERT INTO pic_entry VALUES(3,1,'tool_result','Successfully wrote to notes.txt',1);
INSERT INTO pic_entry VALUES(4,1,'answer','[{"type":"text","text":"done"}]',NULL);
INSERT INTO pic_effect VALUES(1,2,0,'toolu_old','write','{"path":"notes.txt","content":"hi"}',1,'done','Successfully wrote to notes.txt',0,NULL);
INSERT INTO pic_generation VALUES(1,1,0,1,'done',2,'tool_use',NULL,NULL,NULL);
INSERT INTO pic_generation VALUES(2,1,1,1,'done',4,'end_turn',NULL,NULL,NULL);