Add a v3 task_transitions table (additive migration + startup assertion) and a fail-soft, idempotent TransitionRecorder. build_graph gains an injected transition_recorder that wraps every node via a functools.wraps'd _instrument (signature-preserving so LangGraph still injects RunnableConfig); the coordinator wires it. Records one row per node entry (idempotent under resume replay) and closes the open row on terminal status. Backs the dashboard task-history view.
31 lines
817 B
Python
31 lines
817 B
Python
"""SQLite schema and connection helpers for the R720 agent-team pipeline.
|
|
|
|
SQL DDL lives ONLY in this subpackage (``schema.py`` constants mirrored by the
|
|
companion ``schema.sql``). The LangGraph ``SqliteSaver`` checkpointer creates
|
|
its own tables against the same database file.
|
|
"""
|
|
|
|
from agent_team.db.schema import (
|
|
BUDGET_LEDGER_DDL,
|
|
PENDING_QUESTIONS_DDL,
|
|
SCHEMA_VERSION,
|
|
TASK_TRANSITIONS_DDL,
|
|
assert_task_transitions_ready,
|
|
connect,
|
|
init_db,
|
|
migrate,
|
|
)
|
|
from agent_team.db.transitions import TransitionRecorder, read_transitions
|
|
|
|
__all__ = [
|
|
"BUDGET_LEDGER_DDL",
|
|
"PENDING_QUESTIONS_DDL",
|
|
"SCHEMA_VERSION",
|
|
"TASK_TRANSITIONS_DDL",
|
|
"TransitionRecorder",
|
|
"assert_task_transitions_ready",
|
|
"connect",
|
|
"init_db",
|
|
"migrate",
|
|
"read_transitions",
|
|
]
|