generated from coulomb/repo-seed
Finish CUST-WP-0011 and implement STATE-WP-0061 suggestion backlog.
Add persisted Suggestion entities with WSJF ranking, relevance bumps, REST/MCP write surfaces, /suggestions dashboard page, and daily triage digest integration. Document the cluster operating model, archive the completed migration workplan, and seed WARDEN-WP-0012 routing scenarios.
This commit is contained in:
96
api/schemas/suggestion.py
Normal file
96
api/schemas/suggestion.py
Normal file
@@ -0,0 +1,96 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from api.models.suggestion import SuggestionStage
|
||||
|
||||
|
||||
class SuggestionNoteRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
suggestion_id: uuid.UUID
|
||||
stage: str
|
||||
author: str | None = None
|
||||
content: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class SuggestionRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
domain_id: uuid.UUID
|
||||
domain_slug: str = ""
|
||||
topic_id: uuid.UUID | None = None
|
||||
workplan_id: uuid.UUID | None = None
|
||||
title: str
|
||||
description: str | None = None
|
||||
origin: str | None = None
|
||||
origin_ref: str | None = None
|
||||
stage: SuggestionStage
|
||||
relevance: int
|
||||
relevance_events: int
|
||||
last_requested_at: datetime | None = None
|
||||
base_value: float
|
||||
job_size: float
|
||||
relevance_weight: float
|
||||
promoted_task_id: uuid.UUID | None = None
|
||||
cost_of_delay: float | None = None
|
||||
wsjf: float | None = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
notes: list[SuggestionNoteRead] = Field(default_factory=list)
|
||||
|
||||
|
||||
class SuggestionCreate(BaseModel):
|
||||
domain: str
|
||||
title: str
|
||||
description: str | None = None
|
||||
topic_id: uuid.UUID | None = None
|
||||
workplan_id: uuid.UUID | None = None
|
||||
origin: str | None = None
|
||||
origin_ref: str | None = None
|
||||
base_value: float = 3.0
|
||||
job_size: float = 3.0
|
||||
relevance_weight: float = 1.0
|
||||
|
||||
|
||||
class SuggestionVet(BaseModel):
|
||||
author: str | None = None
|
||||
note: str
|
||||
base_value: float | None = None
|
||||
job_size: float | None = None
|
||||
relevance_weight: float | None = None
|
||||
workplan_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class SuggestionDecline(BaseModel):
|
||||
author: str | None = None
|
||||
note: str
|
||||
|
||||
|
||||
class SuggestionPromote(BaseModel):
|
||||
author: str | None = None
|
||||
note: str | None = None
|
||||
task_title: str | None = None
|
||||
task_description: str | None = None
|
||||
task_priority: str = "medium"
|
||||
task_status: str = "wait"
|
||||
|
||||
|
||||
class SuggestionBumpRelevance(BaseModel):
|
||||
reason: str | None = None
|
||||
author: str | None = None
|
||||
|
||||
|
||||
class RankedSuggestionDigest(BaseModel):
|
||||
id: uuid.UUID
|
||||
title: str
|
||||
stage: SuggestionStage
|
||||
domain_slug: str
|
||||
origin_ref: str | None = None
|
||||
relevance: int
|
||||
wsjf: float
|
||||
last_requested_at: datetime | None = None
|
||||
Reference in New Issue
Block a user