feat: trust explicit user goals
This commit is contained in:
+22
-2
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
from typing import Annotated, Literal
|
||||
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
@@ -36,7 +36,14 @@ class IdeaAssessment(BaseModel):
|
||||
)
|
||||
title: str = Field(min_length=1, max_length=80)
|
||||
summary: str = Field(min_length=1, max_length=280)
|
||||
maturity: float = Field(ge=0, le=100)
|
||||
maturity: float = Field(
|
||||
ge=0,
|
||||
le=100,
|
||||
description=(
|
||||
"Position of the evolving idea itself, never a score of the user or "
|
||||
"a probability of success."
|
||||
),
|
||||
)
|
||||
confidence: float = Field(ge=0, le=1)
|
||||
motion: str = Field(min_length=1, max_length=24)
|
||||
position: str = Field(min_length=1, max_length=120)
|
||||
@@ -73,6 +80,15 @@ class IdeaAssessment(BaseModel):
|
||||
|
||||
|
||||
class CuratorDecision(BaseModel):
|
||||
direction_signal: Literal["explicit", "implicit", "none"] = Field(
|
||||
description=(
|
||||
"explicit when the user names this as their goal, idea, project, "
|
||||
"work, plan, question, inquiry, decision, or commitment; implicit "
|
||||
"when a future-bearing direction is inferred; none when no such "
|
||||
"direction is present. Tone, ambition, feasibility, and missing "
|
||||
"steps must not downgrade an explicit signal."
|
||||
)
|
||||
)
|
||||
standalone: bool = Field(
|
||||
description="True when the fragment should remain only in the raw stream for now."
|
||||
)
|
||||
@@ -84,6 +100,10 @@ class CuratorDecision(BaseModel):
|
||||
|
||||
@model_validator(mode="after")
|
||||
def decision_is_coherent(self) -> "CuratorDecision":
|
||||
if self.direction_signal == "explicit" and self.standalone:
|
||||
raise ValueError(
|
||||
"an explicit user-declared direction cannot remain standalone"
|
||||
)
|
||||
if self.standalone and self.assessments:
|
||||
raise ValueError("standalone decisions cannot contain assessments")
|
||||
if not self.standalone and not self.assessments:
|
||||
|
||||
Reference in New Issue
Block a user