Skip to content
pi-c Artifact [1a687a6238]
Login

Artifact [1a687a6238]

Artifact 1a687a623851aad3fb3756f447a249988f47455cec274f1701e91d640a44fd57:


-- 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,'old-1','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);