Skip to content

Fix EndOf cycle final_date off-by-one#70

Open
rymiwe wants to merge 2 commits intomainfrom
fix/end-of-off-by-one
Open

Fix EndOf cycle final_date off-by-one#70
rymiwe wants to merge 2 commits intomainfrom
fix/end-of-off-by-one

Conversation

@rymiwe
Copy link

@rymiwe rymiwe commented Mar 17, 2026

Summary

Split from #69 per review feedback — this PR contains only the EndOf bugfix (QUAL-6189).

  • EndOf#final_date subtracted 1 period before adding period_count, causing V1E12M to expire at end of month 11 instead of month 12
  • Removed the - 1.send(period) offset so notation matches user expectations

Example — V1E12M from Dec 1, 2025:

  • Before: expires Nov 30, 2026 (11 months)
  • After: expires Dec 31, 2026 (12 months)

Confirmed by AFMAN 10-3500V1 A2.3.3: "For tasks with a minimum frequency determined by months, currency on the task is maintained through the last day of the expiration month."

SOFJTAC migration note

If SOFJTAC is reactivated, JTAC EndOf cycles will compute differently under this fix. Per jdowd: JTACs described evaluations as "18 month cycle" but the old code gave them 17 months. If no one compensated by bumping the period count (e.g., using V1E19M to get 18 actual months), existing notations are now correct per AFMAN and no migration is needed. Worth verifying against JTAC seed data before reactivation.

Test plan

  • All 179 existing gem specs pass with updated expectations

Fixes QUAL-6189
Split from #69

EndOf#final_date subtracted 1 period before adding period_count,
causing V1E12M to expire at end of month 11 instead of month 12.
Remove the offset so the notation matches user expectations:
V1E12M from Dec 1 now correctly expires Dec 31 (not Nov 30).

Fixed: EndOf cycle expiration was 1 month early (QUAL-6189)
@rymiwe rymiwe marked this pull request as ready for review March 20, 2026 06:07
@rymiwe rymiwe requested review from a team March 20, 2026 06:20
With the off-by-one fixed, "18th month" is literally correct.
"18th subsequent month" was ambiguous about whether it meant
"18 months after" or "the 18th month following the current one."

Also simplifies dormant_to_s from heredoc+squish to a plain string,
and renames subsequent_ordinal to ordinalized_period_count.
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