18 lines
636 B
Python
18 lines
636 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from control_plane.projects.models import Decision, Project
|
||
|
|
|
||
|
|
|
||
|
|
class ProjectBrainContextBuilder:
|
||
|
|
def build(self, project: Project) -> dict[str, object]:
|
||
|
|
return {
|
||
|
|
"goal": project.goal,
|
||
|
|
"architecture_summary": project.architecture_summary,
|
||
|
|
"current_plan_version": project.current_plan_version,
|
||
|
|
"decisions": list(
|
||
|
|
Decision.objects.filter(project=project).order_by("-created_at").values(
|
||
|
|
"decision_type", "decision", "reason", "evidence", "actor", "created_at"
|
||
|
|
)[:20]
|
||
|
|
),
|
||
|
|
}
|