semantic update
This commit is contained in:
@@ -16,6 +16,9 @@ from pydantic import BaseModel, Field, field_validator, model_validator
|
||||
|
||||
|
||||
# [DEF:TaskType:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: Must contain valid generic task type mappings.
|
||||
# @SEMANTICS: enum, type, task
|
||||
# @PURPOSE: Supported normalized task report types.
|
||||
class TaskType(str, Enum):
|
||||
LLM_VERIFICATION = "llm_verification"
|
||||
@@ -27,6 +30,9 @@ class TaskType(str, Enum):
|
||||
|
||||
|
||||
# [DEF:ReportStatus:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: TaskStatus enum mapping logic holds.
|
||||
# @SEMANTICS: enum, status, task
|
||||
# @PURPOSE: Supported normalized report status values.
|
||||
class ReportStatus(str, Enum):
|
||||
SUCCESS = "success"
|
||||
@@ -37,6 +43,9 @@ class ReportStatus(str, Enum):
|
||||
|
||||
|
||||
# [DEF:ErrorContext:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: The properties accurately describe error state.
|
||||
# @SEMANTICS: error, context, payload
|
||||
# @PURPOSE: Error and recovery context for failed/partial reports.
|
||||
class ErrorContext(BaseModel):
|
||||
code: Optional[str] = None
|
||||
@@ -46,6 +55,9 @@ class ErrorContext(BaseModel):
|
||||
|
||||
|
||||
# [DEF:TaskReport:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: Must represent canonical task record attributes.
|
||||
# @SEMANTICS: report, model, summary
|
||||
# @PURPOSE: Canonical normalized report envelope for one task execution.
|
||||
class TaskReport(BaseModel):
|
||||
report_id: str
|
||||
@@ -69,6 +81,9 @@ class TaskReport(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportQuery:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: Time and pagination queries are mutually consistent.
|
||||
# @SEMANTICS: query, filter, search
|
||||
# @PURPOSE: Query object for server-side report filtering, sorting, and pagination.
|
||||
class ReportQuery(BaseModel):
|
||||
page: int = Field(default=1, ge=1)
|
||||
@@ -105,6 +120,9 @@ class ReportQuery(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportCollection:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: Represents paginated data correctly.
|
||||
# @SEMANTICS: collection, pagination
|
||||
# @PURPOSE: Paginated collection of normalized task reports.
|
||||
class ReportCollection(BaseModel):
|
||||
items: List[TaskReport]
|
||||
@@ -117,6 +135,9 @@ class ReportCollection(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportDetailView:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @INVARIANT: Incorporates a report and logs correctly.
|
||||
# @SEMANTICS: view, detail, logs
|
||||
# @PURPOSE: Detailed report representation including diagnostics and recovery actions.
|
||||
class ReportDetailView(BaseModel):
|
||||
report: TaskReport
|
||||
|
||||
Reference in New Issue
Block a user