feat: recover evolving threads from freeform notes

This commit is contained in:
wuyang
2026-07-29 16:21:48 +08:00
parent af7bb68268
commit 953f69e092
7 changed files with 238 additions and 24 deletions
+21
View File
@@ -44,12 +44,33 @@ class IdeaAssessment(BaseModel):
trajectory: str = Field(min_length=1, max_length=280)
possible_moves: list[str] = Field(min_length=1, max_length=4)
relevance: float = Field(default=1, ge=0, le=1)
supporting_fragment_ids: list[str] = Field(
default_factory=list,
max_length=6,
description=(
"Ids of earlier fragments from recent_context that are substantive "
"evidence for this same evolving thread. The new fragment is linked "
"automatically and must not be included."
),
)
@field_validator("possible_moves")
@classmethod
def moves_are_brief(cls, moves: list[str]) -> list[str]:
return [move.strip()[:100] for move in moves if move.strip()][:4]
@field_validator("supporting_fragment_ids")
@classmethod
def supporting_fragments_are_unique(
cls, fragment_ids: list[str]
) -> list[str]:
unique: list[str] = []
for fragment_id in fragment_ids:
value = fragment_id.strip()
if value and value not in unique:
unique.append(value)
return unique[:6]
class CuratorDecision(BaseModel):
standalone: bool = Field(