Skip to content

refactor: value object pattern for Role, FinishReason, SourceType, and time triggers#159

Merged
esceptico merged 2 commits intomainfrom
feat/value-objects
Mar 29, 2026
Merged

refactor: value object pattern for Role, FinishReason, SourceType, and time triggers#159
esceptico merged 2 commits intomainfrom
feat/value-objects

Conversation

@esceptico
Copy link
Copy Markdown
Owner

Summary

  • Introduce Role, FinishReason, SourceType StrEnums in llm/types.py and memory/models.py — replace raw string literals across 33 files
  • Introduce TimeOfDay, Interval, DaySpec frozen dataclasses in automation/triggers.py — replace repeated string parsing for time trigger fields
  • Convert role-dispatch if/elif chains to match/case in LLM provider message conversion
  • Remove dead parse_days/validate_days/resolve_days wrappers

Replace raw string literals for message roles, finish reasons, and
memory source types with StrEnum value objects. Convert role-dispatch
if/elif chains to match/case in LLM provider message conversion.
Replace raw string parsing for time triggers with typed value objects
that own their validation and parsing. TimeTrigger fields coerce from
strings in __post_init__, eliminating repeated re-parsing in
compute_next_schedule and compute_next_interval. Remove dead
parse_days/validate_days/resolve_days wrappers.
@esceptico esceptico merged commit 2e59664 into main Mar 29, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant