Clean up nested duplicate: v2/v2/kintsugi_vendor/kintsugi/bdi/models.py
Browse files
v2/v2/kintsugi_vendor/kintsugi/bdi/models.py
DELETED
|
@@ -1,96 +0,0 @@
|
|
| 1 |
-
"""BDI runtime models using pure dataclasses."""
|
| 2 |
-
|
| 3 |
-
from dataclasses import dataclass, field
|
| 4 |
-
from datetime import datetime
|
| 5 |
-
from enum import Enum
|
| 6 |
-
from typing import List, Optional
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
class BeliefStatus(Enum):
|
| 10 |
-
ACTIVE = "active"
|
| 11 |
-
ARCHIVED = "archived"
|
| 12 |
-
CHALLENGED = "challenged"
|
| 13 |
-
STALE = "stale"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
class DesireStatus(Enum):
|
| 17 |
-
ACTIVE = "active"
|
| 18 |
-
ACHIEVED = "achieved"
|
| 19 |
-
SUSPENDED = "suspended"
|
| 20 |
-
ABANDONED = "abandoned"
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
class IntentionStatus(Enum):
|
| 24 |
-
ACTIVE = "active"
|
| 25 |
-
COMPLETED = "completed"
|
| 26 |
-
SUSPENDED = "suspended"
|
| 27 |
-
FAILED = "failed"
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
@dataclass
|
| 31 |
-
class BDIBelief:
|
| 32 |
-
id: str
|
| 33 |
-
content: str
|
| 34 |
-
confidence: float
|
| 35 |
-
status: BeliefStatus
|
| 36 |
-
source: str
|
| 37 |
-
tags: List[str]
|
| 38 |
-
created_at: datetime
|
| 39 |
-
last_reviewed: Optional[datetime] = None
|
| 40 |
-
version: int = 1
|
| 41 |
-
evidence: List[str] = field(default_factory=list)
|
| 42 |
-
|
| 43 |
-
def __post_init__(self) -> None:
|
| 44 |
-
if not (0.0 <= self.confidence <= 1.0):
|
| 45 |
-
raise ValueError(f"confidence must be 0-1, got {self.confidence}")
|
| 46 |
-
if self.version < 1:
|
| 47 |
-
raise ValueError(f"version must be >= 1, got {self.version}")
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
@dataclass
|
| 51 |
-
class BDIDesire:
|
| 52 |
-
id: str
|
| 53 |
-
content: str
|
| 54 |
-
priority: float
|
| 55 |
-
status: DesireStatus
|
| 56 |
-
related_tags: List[str]
|
| 57 |
-
measurable: bool
|
| 58 |
-
metric: Optional[str]
|
| 59 |
-
created_at: datetime
|
| 60 |
-
last_reviewed: Optional[datetime] = None
|
| 61 |
-
version: int = 1
|
| 62 |
-
|
| 63 |
-
def __post_init__(self) -> None:
|
| 64 |
-
if not (0.0 <= self.priority <= 1.0):
|
| 65 |
-
raise ValueError(f"priority must be 0-1, got {self.priority}")
|
| 66 |
-
if self.version < 1:
|
| 67 |
-
raise ValueError(f"version must be >= 1, got {self.version}")
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
@dataclass
|
| 71 |
-
class BDIIntention:
|
| 72 |
-
id: str
|
| 73 |
-
goal: str
|
| 74 |
-
status: IntentionStatus
|
| 75 |
-
belief_ids: List[str]
|
| 76 |
-
desire_ids: List[str]
|
| 77 |
-
created_at: datetime
|
| 78 |
-
last_reviewed: Optional[datetime] = None
|
| 79 |
-
version: int = 1
|
| 80 |
-
progress: float = 0.0
|
| 81 |
-
|
| 82 |
-
def __post_init__(self) -> None:
|
| 83 |
-
if not (0.0 <= self.progress <= 1.0):
|
| 84 |
-
raise ValueError(f"progress must be 0-1, got {self.progress}")
|
| 85 |
-
if self.version < 1:
|
| 86 |
-
raise ValueError(f"version must be >= 1, got {self.version}")
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
@dataclass
|
| 90 |
-
class BDISnapshot:
|
| 91 |
-
org_id: str
|
| 92 |
-
beliefs: List[BDIBelief]
|
| 93 |
-
desires: List[BDIDesire]
|
| 94 |
-
intentions: List[BDIIntention]
|
| 95 |
-
snapshot_at: datetime
|
| 96 |
-
version: int = 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|