34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
"""Unified project operating context contracts."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ProjectOperatingContext(BaseModel):
|
|
context_version: str = "v1"
|
|
current_project_id: int | None = None
|
|
current_repo_scope: str | None = None
|
|
page_anchor: dict[str, Any] = Field(default_factory=dict)
|
|
thread_anchor: dict[str, Any] = Field(default_factory=dict)
|
|
fit_scope: Literal["current_project_and_repo"] = "current_project_and_repo"
|
|
decision_strategy: Literal["answer_then_offer_plan"] = "answer_then_offer_plan"
|
|
|
|
|
|
class ProjectFitBrief(BaseModel):
|
|
project_summary: str | None = None
|
|
repo_summary: str | None = None
|
|
current_capabilities: list[str] = Field(default_factory=list)
|
|
signal_source_anchors: list[str] = Field(default_factory=list)
|
|
constraints: list[str] = Field(default_factory=list)
|
|
recommendation_focus: list[str] = Field(default_factory=list)
|
|
|
|
|
|
class ExecutionRecipe(BaseModel):
|
|
primary_lane: Literal["internal", "external", "plan"] = "internal"
|
|
fit_brief_required: bool = False
|
|
external_evidence_required: bool = False
|
|
plan_handoff_mode: Literal["none", "offer_after_answer", "explicit_plan_now"] = "none"
|