Commit Graph
5 Commits
Author SHA1 Message Date
Joshua King 4163667b07 fix: _is_plain_int on every weekday_set path (from_dict + post-set); shared scan function probes the real guard 2026-09-14 10:53:24 -04:00
Joshua King deb409175a fix: plain-int check pre-coercion everywhere; purity guard scans alias leaf names at any level 2026-09-14 10:51:21 -04:00
Joshua King 6398bd525a fix: pre-coercion weekday entry validation, repr-keyed error sort, exact model names only, relative-import alias scan, strict int typing
- direct list construction validates entries before set() coercion
  (bool collapse and unhashable items both raise RuleValidationError)
- unknown-key error sorts by repr (mixed-type keys never leak TypeError)
- string rule_type accepted ONLY as exact model names: storage aliases
  ('monthly'/'custom'), whitespace padding, and case variants rejected;
  the DAO owns storage-string mapping
- purity guard checks ImportFrom alias names so 'from . import db' is
  caught, not just node.module
- _is_plain_int requires type(value) is int: unhashable int subclasses
  cannot construct
2026-09-14 10:48:11 -04:00
Joshua King 9fd06f40bb fix: address review findings - frozen dataclass, type-exclusive validation, storage mapping, strict from_dict, resolved-module purity guard
- RuleType values are now unique model names with an explicit
  storage_value mapping (monthly_day/monthly_weekday -> 'monthly',
  custom_days -> 'custom'), fixing the enum aliasing collapse where
  two members sharing a value collapsed into one
- to_dict serializes the model name so from_dict(to_dict()) is a true
  lossless round-trip; storage mapping is the DAO's documented job
- real @dataclass(frozen=True); non-string non-enum rule_type rejected
- every type carries ONLY its shape's fields: weekday_set forbidden on
  DAILY/monthly/yearly; day_of_month+nth forbidden on WEEKLY/CUSTOM_DAYS/
  YEARLY; month forbidden on monthly rules (the earlier silent-accept of
  these was the root cause behind the kwargs1 mystery)
- from_dict validates weekday_set entries BEFORE set() coercion ([0,
  False] cannot collapse) and never leaks raw TypeError from unknown-key
  sorting
- purity guard resolves the module by find_spec so relative 'from .db'
  imports are caught
2026-09-14 10:44:59 -04:00
Joshua King d006d0606d feat: add ScheduleRule model with validation and serialization (#25) 2026-09-14 10:34:38 -04:00