day 1: Kin from zero to production - agents, GUI, autopilot, 352 tests
This commit is contained in:
parent
8d9facda4f
commit
8a6f280cbd
22 changed files with 1907 additions and 103 deletions
|
|
@ -9,6 +9,12 @@ from datetime import datetime
|
|||
from typing import Any
|
||||
|
||||
|
||||
VALID_TASK_STATUSES = [
|
||||
"pending", "in_progress", "review", "done",
|
||||
"blocked", "decomposed", "cancelled",
|
||||
]
|
||||
|
||||
|
||||
def _row_to_dict(row: sqlite3.Row | None) -> dict | None:
|
||||
"""Convert sqlite3.Row to dict with JSON fields decoded."""
|
||||
if row is None:
|
||||
|
|
@ -249,6 +255,19 @@ def get_decisions(
|
|||
return _rows_to_list(conn.execute(query, params).fetchall())
|
||||
|
||||
|
||||
def get_decision(conn: sqlite3.Connection, decision_id: int) -> dict | None:
|
||||
"""Get a single decision by id."""
|
||||
row = conn.execute("SELECT * FROM decisions WHERE id = ?", (decision_id,)).fetchone()
|
||||
return _row_to_dict(row) if row else None
|
||||
|
||||
|
||||
def delete_decision(conn: sqlite3.Connection, decision_id: int) -> bool:
|
||||
"""Delete a decision by id. Returns True if deleted, False if not found."""
|
||||
cur = conn.execute("DELETE FROM decisions WHERE id = ?", (decision_id,))
|
||||
conn.commit()
|
||||
return cur.rowcount > 0
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Modules
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue