@@ -82,6 +82,12 @@ export class Store {
8282 } catch {
8383 // Column already exists — safe to ignore
8484 }
85+ // Add review column to persist cross-agent review results
86+ try {
87+ this . db . exec ( "ALTER TABLE tasks ADD COLUMN review TEXT" ) ;
88+ } catch {
89+ // Column already exists — safe to ignore
90+ }
8591 // Indexes for common query patterns
8692 this . db . exec (
8793 "CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status)"
@@ -115,6 +121,7 @@ export class Store {
115121 JSON . stringify ( task . tags ?? [ ] ) ,
116122 task . dependsOn ?? null , task . webhookUrl ?? null , task . summary ?? null ,
117123 task . agent ?? "claude" ,
124+ JSON . stringify ( task . review ?? null ) ,
118125 ] ;
119126 }
120127
@@ -126,8 +133,8 @@ export class Store {
126133 (id, prompt, status, worktree, output, error, events, created_at,
127134 started_at, completed_at, timeout, max_budget, cost_usd,
128135 token_input, token_output, duration_ms, retry_count, max_retries, priority, tags,
129- depends_on, webhook_url, summary, agent)
130- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
136+ depends_on, webhook_url, summary, agent, review )
137+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
131138 ` ) . run ( ...params ) ;
132139 if ( insertResult . changes === 0 ) {
133140 // Row already exists — update it (params[0] is id, rest are fields; append id at end for WHERE)
@@ -136,7 +143,7 @@ export class Store {
136143 prompt=?, status=?, worktree=?, output=?, error=?, events=?, created_at=?,
137144 started_at=?, completed_at=?, timeout=?, max_budget=?, cost_usd=?,
138145 token_input=?, token_output=?, duration_ms=?, retry_count=?, max_retries=?,
139- priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?
146+ priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?, review=?
140147 WHERE id=?
141148 ` ) . run ( ...params . slice ( 1 ) , task . id ) ;
142149 }
@@ -153,15 +160,15 @@ export class Store {
153160 (id, prompt, status, worktree, output, error, events, created_at,
154161 started_at, completed_at, timeout, max_budget, cost_usd,
155162 token_input, token_output, duration_ms, retry_count, max_retries, priority, tags,
156- depends_on, webhook_url, summary, agent)
157- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
163+ depends_on, webhook_url, summary, agent, review )
164+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
158165 ` ) ;
159166 const updateStmt = this . db . prepare ( `
160167 UPDATE tasks SET
161168 prompt=?, status=?, worktree=?, output=?, error=?, events=?, created_at=?,
162169 started_at=?, completed_at=?, timeout=?, max_budget=?, cost_usd=?,
163170 token_input=?, token_output=?, duration_ms=?, retry_count=?, max_retries=?,
164- priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?
171+ priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?, review=?
165172 WHERE id=?
166173 ` ) ;
167174 const runAll = this . db . transaction ( ( batch : Task [ ] ) => {
@@ -191,15 +198,15 @@ export class Store {
191198 (id, prompt, status, worktree, output, error, events, created_at,
192199 started_at, completed_at, timeout, max_budget, cost_usd,
193200 token_input, token_output, duration_ms, retry_count, max_retries, priority, tags,
194- depends_on, webhook_url, summary, agent)
195- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
201+ depends_on, webhook_url, summary, agent, review )
202+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
196203 ` ) ;
197204 const updateStmt = this . db . prepare ( `
198205 UPDATE tasks SET
199206 prompt=?, status=?, worktree=?, output=?, error=?, events=?, created_at=?,
200207 started_at=?, completed_at=?, timeout=?, max_budget=?, cost_usd=?,
201208 token_input=?, token_output=?, duration_ms=?, retry_count=?, max_retries=?,
202- priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?
209+ priority=?, tags=?, depends_on=?, webhook_url=?, summary=?, agent=?, review=?
203210 WHERE id=?
204211 ` ) ;
205212 this . transaction ( ( ) => {
@@ -243,6 +250,7 @@ export class Store {
243250 webhookUrl : { col : "webhook_url" } ,
244251 summary : { col : "summary" } ,
245252 agent : { col : "agent" } ,
253+ review : { col : "review" , serialize : ( v ) => JSON . stringify ( v ) } ,
246254 } ;
247255
248256 const setClauses : string [ ] = [ ] ;
@@ -400,6 +408,8 @@ export class Store {
400408 webhookUrl : row . webhook_url ?? undefined ,
401409 summary : row . summary ?? undefined ,
402410 agent : row . agent ?? "claude" ,
411+ // ?? undefined converts null (from JSON.parse("null")) back to undefined
412+ review : this . safeJsonParse ( row . review , undefined ) ?? undefined ,
403413 } ;
404414 }
405415
0 commit comments