Open
Conversation
a96a4be to
c9c5e5c
Compare
rymiwe
added a commit
that referenced
this pull request
Mar 18, 2026
Alternative to #71 (Interval) — same behavior, different class structure. RepeatingWithin subclasses Within to make the relationship explicit. V1I24MF2026-03-31 = complete 1 every 24 months from March 31, 2026. After satisfaction, consuming app calls reactivated_notation(date) to start the next window. Overrides from Within: - recurring? → true (Within is false) - to_s → "every...from" format (Within uses "within...range") - extend_period → no-op (re-anchors instead of extending) - last_completed → returns from_date (current window anchor) - expiration_of → returns final_date - satisfied_by? → checks anchor <= final_date - start_date/final_date → nil-safe for dormant state Also adds reactivated_notation(date) alias for activated_notation to make the re-anchoring call site self-documenting.
4 tasks
Each cycle class now declares its own dormant capability: def self.dormant_capable? = true # EndOf, Within def self.dormant_capable? = false # Cycle base (default) Parser.dormant_capable_kinds now derives the list from Cycle.cycle_handlers instead of a hardcoded array. This means adding a new dormant-capable cycle kind only requires declaring dormant_capable? on the class — no separate Parser edit needed.
New cycle type for repeating windows anchored to a from_date. V1I24MF2026-03-31 = complete 1 every 24 months from March 31, 2026. After completion, consuming app re-anchors from the completion date. Named "Interval" (not "Recurring") to avoid collision with the existing Cycle#recurring? predicate which indicates whether a cycle type repeats. Key differences from Within: - recurring? returns true (Within returns false) - #to_s uses "every...from" format (Within uses "within...range") - No extend_period (window re-anchors, not extends) Dormant behavior handled by Dormant wrapper via Parser.dormant_capable_kinds, consistent with Within pattern (no redundant guards in class methods).
- reactivated_notation(date) aliases activated_notation for self-documenting call sites when re-anchoring a satisfied Interval - Specs verify Interval computes final_date/start_date identically to Within, documenting the conceptual relationship
52f0e05 to
d0f186b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New cycle type for repeating windows anchored to a from_date, split from #69 per review feedback.
V1I24MF2026-03-31= complete 1 every 24 months from March 31, 2026. After completion, the consuming app re-anchors from the completion date viareactivated_notation(completion_date).Review feedback addressed (from #69)
RecurringtoIntervalto avoid collision withCycle#recurring?predicate (which means "does this cycle type repeat?" — Lookback, Calendar, EndOf all returntrue)RtoIto match the convention (every kind uses its first letter: Lookback, Calendar, Within, EndOf, Interval)def self.dormant_capable? = trueon the class (uses Move dormant_capable? from Parser to cycle classes #73's pattern instead of editing Parser's hardcoded list)#to_suses"every...from"format vs Within's"within...range";#descriptionexplains re-anchoring;#examplesshow the distinctionInotation makes re-anchoring intent explicit in the notation string, so consuming apps don't need external metadata to know whichWcycles should re-anchorBonus:
reactivated_notationaliasreactivated_notation(date)aliasesactivated_notation(date)for self-documenting call sites when re-anchoring a satisfied cycle.Key differences from Within
W)I)recurring?falsetruedormant_capable?truetrue#to_s(active)"1x within start - end""1x every 24 months from start"#to_s(dormant)"1x within 24 months""1x every 24 months"extend_periodTest plan
Addresses QUAL-6317
Supersedes #69 (Interval portion)
Depends on #73 (dormant_capable? refactor) and #70 (EndOf fix)