mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-09-18 18:46:17 +00:00
- command-ify the write use cases (RateRun / RetractRunRating; queries keep plain parameters, commands stay dumb data) - split the domain errors into exceptions.py, a peer of model.py (PEP 8 Error suffixes, AWS-style module name) - unify the aggregate->row mapping as _apply(row, feedback) so one explicit field list serves both the insert and the update path - drop the unused feedback.message_id column (migration 0011): feedback is bound to a run, nothing ever wrote or read the field - pin remove_for_run's equality semantics for user_id=None in the contract suite and fix the port docstring that contradicted both implementations
31 lines
881 B
Python
31 lines
881 B
Python
"""Feedback bounded context: a user's rating of a single run.
|
|
|
|
Public API of the context. Import domain objects and the service from
|
|
here; import ports (FeedbackRepository, RunLookup) from
|
|
`deerflow.domain.feedback.ports` -- they are contracts consumed by
|
|
adapters and tests, not everyday call-site symbols.
|
|
"""
|
|
|
|
from deerflow.domain.feedback.commands import RateRun, RetractRunRating
|
|
from deerflow.domain.feedback.exceptions import (
|
|
DuplicateFeedbackError,
|
|
FeedbackError,
|
|
InvalidRatingError,
|
|
InvalidTagError,
|
|
RunNotFoundError,
|
|
)
|
|
from deerflow.domain.feedback.model import Feedback
|
|
from deerflow.domain.feedback.service import FeedbackService
|
|
|
|
__all__ = [
|
|
"DuplicateFeedbackError",
|
|
"Feedback",
|
|
"FeedbackError",
|
|
"FeedbackService",
|
|
"InvalidRatingError",
|
|
"InvalidTagError",
|
|
"RateRun",
|
|
"RetractRunRating",
|
|
"RunNotFoundError",
|
|
]
|