Backend: - Add Tavily web search tool wrapper (tools/web_search.py) - Add PDF reader + ChromaDB vector store tool (tools/pdf_reader.py) - Bind tools to LLM calls via .bind_tools() in dynamic_graph_builder - Implement God Mode using LangGraph interrupt_before + MemorySaver - Add approve/reject/modify API endpoints for God Mode - Add PDF upload endpoint with ingestion pipeline - Add persistent run history (CouncilRun model + run_service + API) - Add Alembic migration for council_runs table - Enhance WebSocket to emit run_paused and run_resumed events - Add tests for tools, God Mode, and run history Frontend: - Add God Mode approval UI (GodModePanel component) - Add Auto-Pilot / God Mode toggle in Konferenzzimmer - Add functional PDF upload handler - Add Conditional Edge editor (EdgeSettingsPanel component) - Add edge click selection in ArchitectCanvas - Update Zustand store with edge selection and update actions - Update types for God Mode, execution modes, and WS events - Update API client with God Mode, PDF upload, and blueprint run endpoints - Update WebSocket hook for paused/resumed events - Add Vitest config and frontend tests (store, parser, types, API) https://claude.ai/code/session_017U6idFgaqnYTXzPxA7mxMv
71 lines
2.1 KiB
Python
71 lines
2.1 KiB
Python
"""
|
|
CouncilRun model — persists council run history in PostgreSQL.
|
|
|
|
Each run record stores the execution metadata, status, and results.
|
|
Replaces the in-memory run_store for persistent storage.
|
|
"""
|
|
|
|
import uuid
|
|
from datetime import datetime, timezone
|
|
|
|
from sqlalchemy import Column, DateTime, Float, Integer, String, Text
|
|
from models.blueprint import Base
|
|
|
|
|
|
class CouncilRun(Base):
|
|
"""
|
|
A persisted council run stored in PostgreSQL.
|
|
|
|
Tracks the full lifecycle of a run: pending → running → completed/failed/paused.
|
|
"""
|
|
|
|
__tablename__ = "council_runs"
|
|
|
|
id = Column(
|
|
String(36),
|
|
primary_key=True,
|
|
default=lambda: str(uuid.uuid4()),
|
|
)
|
|
blueprint_id = Column(String(36), nullable=True)
|
|
input_topic = Column(Text, nullable=False)
|
|
status = Column(
|
|
String(20),
|
|
nullable=False,
|
|
default="pending",
|
|
)
|
|
execution_mode = Column(
|
|
String(20),
|
|
nullable=False,
|
|
default="auto-pilot",
|
|
)
|
|
final_draft = Column(Text, nullable=True)
|
|
critic_score = Column(Float, nullable=True)
|
|
iteration_count = Column(Integer, nullable=True)
|
|
active_node = Column(String(255), nullable=True)
|
|
error = Column(Text, nullable=True)
|
|
created_at = Column(
|
|
DateTime(timezone=True),
|
|
nullable=False,
|
|
default=lambda: datetime.now(timezone.utc),
|
|
)
|
|
completed_at = Column(
|
|
DateTime(timezone=True),
|
|
nullable=True,
|
|
)
|
|
|
|
def to_dict(self) -> dict:
|
|
"""Serialize to a JSON-friendly dict."""
|
|
return {
|
|
"id": self.id,
|
|
"blueprint_id": self.blueprint_id,
|
|
"input_topic": self.input_topic,
|
|
"status": self.status,
|
|
"execution_mode": self.execution_mode,
|
|
"final_draft": self.final_draft,
|
|
"critic_score": self.critic_score,
|
|
"iteration_count": self.iteration_count,
|
|
"active_node": self.active_node,
|
|
"error": self.error,
|
|
"created_at": self.created_at.isoformat() if self.created_at else None,
|
|
"completed_at": self.completed_at.isoformat() if self.completed_at else None,
|
|
}
|